Assembly-C Sharp, Assembly-C Sharp-firstpass etc

Discussion in 'Scripting' started by meatbag, Apr 28, 2012.

  1. meatbag

    meatbag

    New Member

    Joined:
    Feb 6, 2012
    Messages:
    3
    Opening my solution in MonoDevelop shows 4 assemblies.

    Assembly-C Sharp
    Assembly-CSharp-Editor
    Assembly-CSharp-Editor-firstpass <---
    Assembly-C Sharp-firstpass <---

    What are these first pass assemblies? Is it normal to see 4 assemblies or should they not be there?
  2. Tseng

    Tseng

    Member

    Joined:
    Nov 29, 2010
    Messages:
    1,215
    Scripts which are in the "Standard Assets" folder (or the mobile version of it) get compiled into the firstpass assemblies.

    It's some horrible mess due to Unity's way to compile different languages and where compile order is important. I.e. in order for UnityScripts to access scripts written in C#, C# has to be compiled before UnityScript are compiled. This in turn means, you can not access UnityScript from C# w/o doing some hacks (i.e. moving UnityScript scripts into Standard Assets folder).

    The compile order is something like

    C# firstpass
    C# firstpass editor
    UnityScript firstpass
    Unityscript firstpass editor
    C#
    C# Editor
    UnityScript
    UnityScript Editor

    Dunno where boo belongs there
  3. KoRMaK

    KoRMaK

    New Member

    Joined:
    Apr 25, 2013
    Messages:
    4
    I have a C# file in the first pass, and then another one in the regular pass. However When I try to get access to the secondpass object from the first one it complains that it doesn't know the definition.

    It's kind a nuts, and I haven' figured out how to fix it. I created a circular dependency by add reference to the secondpass to the first, so that's out.
  4. makeshiftwings

    makeshiftwings

    Member

    Joined:
    May 28, 2011
    Messages:
    1,709
    The compilation order is here:

    http://docs.unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html

    Those four steps correspond to the four separate projects in your solution.

    The short answer is you can't. First pass scripts can't access second pass scripts. Is there any reason you need to have the first one in the first pass?
  5. ev3d

    ev3d

    Member

    Joined:
    Apr 19, 2013
    Messages:
    91
    sorry to resurrect an old thread but can you "fix" this by converting any javascript or unityscript scripts to c# and moving them out of the "standard assets" folder?