Constant errors when inspecting Custom Unity Events serialized by Odin

Issue #291 resolved
Nicolás Ezcurra
created an issue

As the title says, Unity throw multiple errors for every change done to the inspected UnityEvents. I'm attaching part of the log which contains the errors caused by just changing a bool property. Sometimes it also shows the target object of the event as "Type Mismatch" and turns the entry as read only.

This is not happening with built-in UnityEvent class, just with custom UnityEvent classes which are child of it.

Comments (5)

  1. Bjarke Elias Clauson-Kaas Ørrild

    Thanks for the report. We'll take a look at this tomorrow.

    In the meantime, if you're using Odin's Serialization you could consider just serializing delegates instead of UnityEvents.

        [InlineProperty(LabelWidth = 50)]
        public struct MyEvent<T>
        {
            [SerializeField]
            private T arg1;
    
            [SerializeField, HideLabel]
            private Action<T> action;
    
            public void Invoke()
            {
                this.action(this.arg1);
            }
        }
    
  2. Log in to comment