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
- Any small change in UI Builder Inspector refreshes Editor Inspector
- Inaccurate Box Collider boundaries on a rotated child Cube when the parent GameObject Scale is non-uniform
- [Android] "SHADOWS_SCREEN" set as shader Keyword when no "_ShadowMapTexture" is bound leads to freeze on a build on some Mali GPU devices
- The global scene list is overridden in a project built with command line when the Override Global Scene List setting is disabled in the build profile
- Global Scenes are not included in the Build when building multiple Build Profiles at the same time
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/)