I don’t like the fact that Unity stores enums as the int value of them. Every time you add a new enum without specifying its value, you can easily have wrong enum values on your objects. I want to write a custom enum type like this that implement ISerializationCallbackReceiver:
public struct CustomEnum<T> : ISerializationCallbackReceiver where T : System.Enum
{
public T value;
public void OnBeforeSerialize() { }
public void OnAfterDeserialize() { }
}
But my knowledge of this subject is limited so how can I do this?