Potential Fix/Idea for Network Manager to find DefaultPrefabObjects in project if it is null! #539
Closed
Katerlad
started this conversation in
Feature Request
Replies: 2 comments
-
I believe we can actually just do this without the need for all that trouble. We can do a check on the NetworkManager outside play 'if null' then search the default save path, or whichever path devs specified if they configured it. Should be extremely cheap and fast. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Turns out I already had code I could use for this. Managed to implement it with a few lines of code. 240427-13-20-988.mp4 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We could utilize the built in Resources Library in Unity to search for the DefaultPrefabObjects, if the NetworkManager has a null reference to it.
Changing the FishNet folder to have a "Resources" folder in it will allow you to search for "DefaultPrefabsObject" inside it without a taxing load.
The Resource Library is not recommended for full projects with many assets, by Unity, but should suffice for a addon package like Fishnet to lookup one single asset.
You would have to make a folder inside FishNet called "Resources" and a folder inside that called "FishNetAssets" and inside there should be where the "DefaultPrefabObject" Scriptable Object lives.
FishNet => Resources => FishNetAssets => DefaultPrefabObjects
Then the NetworkManager on Serialization into a scene if the PrefabObjects is null!
Do a Resources.Load< ScriptableObject >(FishNetAssets/DefaultPrefabObjects);
Beta Was this translation helpful? Give feedback.
All reactions