1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Reddit AMA with Adam Myhill on Cinemachine, Thurs July 27 - 10AM PT. More info.
    Dismiss Notice
  6. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  7. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    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,076
    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:
    302
    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?