UnityEvent issue with multiple copies of same script.
I'm getting a weird issue with serialized UnityEvents when two (or more) instances of the same scripts are on the same GameObject. The "+" and "-" controls in the inspector don't work for the first instance of the script, but on the second (or last) instance, the controls work, but actually create new handlers on ALL of the instances of the script, instead of just the one.
Tested in a completely new project. Imported Odin. Created the following script: using UnityEngine; using UnityEngine.Events;
public class Test : MonoBehaviour { [SerializeField] UnityEvent test; }
created an empty in the scene and added two instances of said script to it.
Comments (6)
-
-
Also, forgot to mention I'm using Unity version 2017.3.1f1.
-
I did a bit more testing, and have also noticed that the same issue occurs with two DIFFERENT scripts on the same object, if the UnityEvent variable has the same name.
-
- changed status to resolved
This one is also resolved in 1.0.6.1 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.
We'll submit it to the asset store very soon. Writing patch notes as we speak.
-
Haha, yeah patch notes are fun...
Thanks!
-
- removed milestone
Removing milestone: 1.0.6.0 (automated comment)
- Log in to comment
Sorry - forgot to login before I submitted. This is my issue.