com.unity.netcode.gameobjects
com.unity.netcode.gameobjects copied to clipboard
Expose Network Manager Prefabs List From Internal To Public
Is your feature request related to a problem? Please describe. Its more so a retcon, previous versions of MLAPI had in its NetworkManager a public NetworkPrefab List. Now with the updated Netcode For GameObjects, the list has been internalized.
Describe the solution you'd like I know there is probably a reason for the hiding of the list. I am simply proposing we make the list public. With the requirement that we keep a list of network game objects in the NetworkManager, the list can get long and edited over many times through the iteration processes of development. Previously I had scripts in place that would automatically keep the NetworkPrefab list up to date per my game design. I will be using a lot of different objects. Having the list exposed will allow for more scripted and automatic opportunities, with the current way I will have to manually keep track.
Describe alternatives you've considered So far to keep up my automatic list, I have cloned the latest develop 1.0 pre.3 and edited NetworkPrefabs list to public, NetworkPrefab class public, and NetworkPrefabOverride public, thats all. Besides that, thanks everyone!
You can still manage the list programmatically by registering the prefabs you want using NetworkManager.Singleton.PrefabHandler.AddHandler(a prefab, an handler) in a script instead of registering them using the serialized list "Network Prefabs" in the NetworkManager editor.
You can still manage the list programmatically by registering the prefabs you want using NetworkManager.Singleton.PrefabHandler.AddHandler(a prefab, an handler) in a script instead of registering them using the serialized list "Network Prefabs" in the NetworkManager editor.
I gotcha, in my case I am already utilizing the prefab handler for object pooling. But for cases like scene networked objects, player prefab, or any other objects that aren't being added to the prefab handler and Netcode automatically handles it, it'd just be nice if I could access the global network objects on the server for synchronicity purposes
Echoing the intent of this request, I'd love the prefab list to be readable as well, so I don't have to keep a duplicate copy of the data in sync with Netcode's, which may be error prone and is a duplication of effort/resources really (you've already got it).
If exposing the list as public is a no-no, please at least consider exposing the data as read-only public. I assume additions and removals should always go through network manager's add/remove methods, which is why the list isn't exposed currently.
Lol, I concur! Add Netcode as a package through github, and change the NetworkPrefab class from internal to public, do the same for the enum NetworkPrefabOverride, and the NetworkConfig NetworkPrefabs list to public. That way you dont have to have two separate data structures to work on
Hopefully they can still see this
Add Netcode as a package through github, and change the NetworkPrefab class from internal to public
I'd rather the change be official, so I don't have to manage a private change as Netcode releases more versions.
+1
+1