-
Notifications
You must be signed in to change notification settings - Fork 465
Description
Hello,
I wanted to create a ManagedNetworkList and a ManagedNetworkArray, which works like the NetworkList but allows to store managed objects that implement the INetworkSerializable interface.
My issue is that some functions and properties used in your NetworkList are internal, so I can't use them from my script:
- NetworkManager.BehaviourUpdater
- NetworkBehaviourUpdater.AddForUpdate
- NetworkVariableSerialization.Write
- NetworkVariableSerialization.Read
In the codegen, only types used in NetworkVariable and NetworkList are processed:
https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/b5b8edae4af1aba810bf07efc7f300c2d28a2623/com.unity.netcode.gameobjects/Editor/CodeGen/NetworkBehaviourILPP.cs#L1149C25-L1149C25
You can try to move the NetworkList outside of the package folder and you will see the problem I had.
I ended up having the simplest solution: add those new ManagedNetworkList and ManagedNetworkArray directly in my fork.
I also wanted to make my own NetworkBehaviourReference<T> struct where T is a derived type of the referenced NetworkBehaviour.
NetworkObject.GetNetworkBehaviourAtOrderIndex() was needed but it's internal...
Is there anything preventing those function to be public? Could you "Unrestrict" the codegen?
Do you have any recommendations to extend the SDK?