Serialized UnityEvents lose the references of what was set on them

Issue #323 invalid
Anonymous created an issue

For Odin Version

Steps to reproduce: 1. Create a MonoBehaviour with the code below. 2. Go to Unity so that the code is compiled. 3. Add some stuff to some of the events in the inspector. 4. Go to the code and change or add a UnityEvent variable. 5. Go back to unity to recompile 6. Confusion.

For some reason some of the functions being added to the events are being lost upon recompilation. What am I doing wrong? Shouldn't variables of the same type retain the inspector references and information after a name change?

They also lose references when simply adding new variables to the code.

        public enum MTActionType { TurnOn, TurnOff };
    [TabGroup("ParentGroup", "StateEvents")]
    public bool a;
    [TabGroup("ParentGroup", "ProgressEvents")]
    public bool b;

    public UnityEvent activationActions;
    public UnityEvent deactivationActions;
    public UnityEvent StartActions;
    public UnityEvent CancelActions;
    public UnityEvent CompletedActions;
    public UnityEvent FailedActions;
    public UnityEvent Unfinished;
    public UnityEvent Finished;

Comments (2)

  1. Tor Esa Vestergaard

    This issue isn't very well explained - as far as I can tell, this is all working as intended. These fields are even serialized by Unity, and not Odin. Until some reproduction steps showing a clear Odin-related error show up, I'm marking this as invalid.

  2. Log in to comment