I referenced NetworkList and implemented my own NetworkObjectList through NetworkVariableBase. It will convert NetworkObject to NetworkObjectReference when writing, and convert NetworkObjectReference to NetworkObject when reading
This NetworkObject List has no issues when connected normally, but it may encounter issues when a client completely rejoins the game
For example, an object with ID 1 has a NetworkObjectList that contains an object with ID 2 When fully rejoining, the first step is to load the NetworkObject with ID 1 and load its own NetworkObjectList. Converting the NetworkObject Reference with ID 2 to NetworkObject will result in the inability to retrieve the object properly and cause an error
So I would like to ask if there is any good way to solve this problem of synchronizing a complete List?
I would simply go for a NetworkList because NetworkObjectReference does nothing but serialize the NetworkObjectId (ulong).
You can look up objects by their NetworkObjectId via NetworkManager.Singleton.SpawnManager and then access the SpawnedObjects (not sure about spelling) dictionary which has the objects keyed by NetworkObjectId.
I have tried doing this before, but in reality, it can also cause problems When fully reloading, trigger SceneEventData.SynchronizeSceneNetworkObjects, each NetworkObject is added separately to the SpawnManager, which may result in some cases not being able to index NetworkObject objects that have not yet been initialized
In the object with NetworkObjectId 1, it is also not possible to obtain the object with NetworkObjectId 2 through SpawnManager. I would like to ask if there is a fully loaded callback, or if it is possible to add such a callback function