Description
Using an enum in a NetworkVariable breaks the inspector for that component.
Reproduce Steps
I have included a small reproduction project, but the steps to do it are short.
EnumFailRepro.zip
- Make an enum
- Use it in a NetworkVariable on a NetworkBehaviour
- Add the NetworkBehaviour to a GameObject
- Note the errors in the logs + the inspector breaking when selecting the GameObject
Actual Outcome
The inspector broke, and some exceptions were logged
Expected Outcome
The inspector renders the inspector correctly with no exceptions
Environment
- OS: Win10
- Unity Version: 2022.2.10f1
- Netcode Version: 08005ff
- Netcode Commit: 08005ff
Additional Context
Looks like the issue was introduced in [https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/65e176e185aeba53988c2093649a9a1f5740dae7] due to adding the constraint of IEquatable to the RenderNetworkContainerValueType function. Enums are not able to implement interfaces, and they dont implement IEquatable. Unsure of how to fix this / dont have time to fix it atm.
Might need to fix it in RenderNetworkVariable itself and have 2 different code paths, one for NetworkVariable and one for NetworkList.
Broke:

After removing IEquatable from RenderNetworkContainerValueType

Description
Using an enum in a NetworkVariable breaks the inspector for that component.
Reproduce Steps
I have included a small reproduction project, but the steps to do it are short.
EnumFailRepro.zip
Actual Outcome
The inspector broke, and some exceptions were logged
Expected Outcome
The inspector renders the inspector correctly with no exceptions
Environment
Additional Context
Looks like the issue was introduced in [https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/65e176e185aeba53988c2093649a9a1f5740dae7] due to adding the constraint of IEquatable to the RenderNetworkContainerValueType function. Enums are not able to implement interfaces, and they dont implement IEquatable. Unsure of how to fix this / dont have time to fix it atm.
Might need to fix it in RenderNetworkVariable itself and have 2 different code paths, one for NetworkVariable and one for NetworkList.
Broke:

After removing IEquatable from RenderNetworkContainerValueType
