Search Unity

Difference between editor and build script (SignalR)?

Discussion in 'Editor & General Support' started by Kretus, Dec 24, 2014.

  1. Kretus

    Kretus

    Joined:
    Dec 24, 2014
    Posts:
    6
    I use SignalR inside Unity3D (SignalR.Client.20 by jenyayel), and this works perfectly inside the editor. When I run the game in the editor, the script makes a connection to the server, and I can use my server to send commands to Unity3D. I use Unity3D 4.6.1f1 (Free).

    However, when I build the application, the script only works in part, and it does not give any warning or errors. It can make a connection to the server (this is confirmed server-side), but it cannot accept any commands from the server. It seems like a part of the script is just not included in the build.

    Things I've tried:

    - Reboot
    - Copy-paste the script in a new script
    - Different elevation levels for runtime
    - Turn off firewall / anti-virus
    - Clean/rebuild solution
    - Build with every setting (Development, Debug, x86, x86-64...)

    Are there any known differences between the editor scripts, and the build scripts? Or could it be a limitation of the free version of Unity3D?
     
  2. Kretus

    Kretus

    Joined:
    Dec 24, 2014
    Posts:
    6
    Bump.

    I've created a new project in a Pro trial version on another machine and imported all the assets, but the result remains the same.
     
  3. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
    Hey there,

    An editor script is just that a script that lives in the editor. Any scripts that are inside an Editor folder will not get include in your build (for good reason). Any scripts that reference UnityEditor.dll and are not in an editor folder will throw and error and stop your build.

    In your case once you build all the editor scripts are removed.

    Regards,
     
  4. Kretus

    Kretus

    Joined:
    Dec 24, 2014
    Posts:
    6
    Well, maybe I explained it rather badly. The script I am referring to, is connected to a GameObject, and does not use the UnityEditor.dll in any way. It does reference an external library (SignalR Client). What I meant with editor script, is the version that is compiled to play in the editor, as opposed to the version that is used in the build.
     
  5. Bigpete591

    Bigpete591

    Joined:
    May 7, 2013
    Posts:
    60
    To anyone running into this issue, it can be solved by setting your Api Compatibility Level to .NET 2.0 (not subset).