Search Issue Tracker
Fixed in 2017.1.X
Votes
3
Found in
5.5.0f3
Issue ID
863274
Regression
No
External dll classes are not recognized if they inherit NetworkBehaviour
Reproduction steps:
1. Open project attached (NetworkBehaviourBug.zip)
2. Go to Assets and check TheEngine.dll.
Expected result: TheEngine class NetworkBehaviourTest will be recognized.
Actual result: TheEngine class NetworkBehaviourTest is not recognized.
Workaround:
Add UnityEngine.Networking.dll under TheEngine.dll and reimport TheEngine.dll.
Reproduced on: 5.3.7p3, 5.4.4f1, 5.5.0p3, 5.6.0b3.
Note: class inherits NetworkBehaviour. For best experience, users should not be forced to add UnityEngine.Networking.dll in order to get their scripts recognized.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android] Error "Blitter is already initialized" is present when Adaptive Probe Volumes are used with OpenGLES3
- VFX Graph effect instance stops rendering when a second instance of the same effect starts 2 frames later
- Operations on the Color32 array are not reflected in WebGL Player when HDR is off
- Rigidbody moves away from the original GameObject when Center of Mass is set in every frame
- WebGL Player does not proceed beyond logo screen when "Target WebAssembly 2023" is enabled
Benzor
May 11, 2017 18:48
To clarify, the workaround is to copy the UnityEngine.Networking.dll such that it's beside your custom TheEngine.dll in the project's folder structure. You can automate this with a post-build step from e.g. Visual Studio.
http://stackoverflow.com/questions/49972/in-what-order-are-locations-searched-to-load-referenced-dlls
deemen
Jan 24, 2017 15:17
I can confirm this issue occurs in 5.5.0p4. The suggested workaround does cause Unity to correctly recognize the NetworkBehaviours, however it's important that the UnityEngine.Networking.dll be correctly flagged as an editor-only DLL otherwise it will cause errors when building the player.
Also note that SyncVars will not work correctly since the UNetWeaver does not run on DLLs (see: https://forum.unity3d.com/threads/networkbehaviour-in-external-dll.368167/)