Search Unity

  1. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  6. Unity 2017.3 beta is now available for download.
    Dismiss Notice

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

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

  1. meatbag

    meatbag

    Joined:
    Feb 6, 2012
    Posts:
    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

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    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

    Joined:
    Apr 25, 2013
    Posts:
    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

    Joined:
    May 28, 2011
    Posts:
    3,203
    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

    Joined:
    Apr 19, 2013
    Posts:
    308
    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?