Search Unity

unity 2018 how to make assmbly define to reference assembly-CShrap.dll

Discussion in 'Scripting' started by tim12332000, Sep 19, 2019.

  1. tim12332000

    tim12332000

    Joined:
    Jun 15, 2017
    Posts:
    20
    Hello eveyone! , when I run a test runner , in unity 2018.4.3 it have to create a Assembly Definition to test ,
    I need "test my game logic" ,So I have to references "assembly-CShrap.dll" but I can't find that !!
    upload_2019-9-19_9-42-48.png

    So I have a tricky solution like that

    https://stackoverflow.com/questions...nity-and-fix-missing-assembly-reference-error

    I create a new Assemlby define to in include all script
    upload_2019-9-19_9-50-46.png
    and reference to test assemlby define
    upload_2019-9-19_9-51-16.png
    Ok it work , But when I load assetbundle Get this error meesage!

    A scripted object (probably UIButton?) has a different serialization layout when loading. (Read 32 bytes but expected 344 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    UnityEngine.AssetBundle:get_mainAsset()

    It look like myAssembly define changed , And My "Old Assetbundle" can not load sccuess ,
    So I dont want to rebuild all Assetbundle , So how can I do ?
     
  2. tim12332000

    tim12332000

    Joined:
    Jun 15, 2017
    Posts:
    20
    I Found soultion : TestRunner -> Setting -> Enable playmode tests for all assmblies
    upload_2019-9-19_11-2-26.png
    Play mode also , But have to reopen Unity after setting