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

    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. Bjarke Elias

    Yup, sorry forgot to mark this one as solved as well. If you want a hotfix for it just shoot us an email from our website with your Odin invoice Id, and I'll send it your way.

  3. Log in to comment