You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UnityEvent has support for common serialized types not inherited from UnityEngine.Object. By debugging the code, it seems that SerializableCallback has a validation method for parameters that checks if they are a value type and inherits from UnityEngine.Object, and returns invalid if they not.
So for feature parity with UnityEvent, SerializableCallback should support these custom types.
Example:
Add this Component to a GameObject, and try to select the dynamic method TestMethod from both the UnityEvent and the SerializableEvent. Only the UnityEvent will provide the option.
usingUnityEngine;usingUnityEngine.Events;publicclassTestCallbackReceiver:MonoBehaviour{[System.Serializable]publicclassTestClass{publicinta;publicintb;}[System.Serializable]publicclassTestUnityEvent:UnityEvent<TestClass,bool,bool>{}[System.Serializable]publicclassTestSerializableCallback:SerializableEvent<TestClass,bool,bool>{}publicTestUnityEventtestEvent;publicTestSerializableCallbacktestSerializableCallback;publicvoidTestMethod(TestClassa,boolb,boolc){Debug.Log("only detected by UnityEvent");}}
The text was updated successfully, but these errors were encountered:
mnicolas94
added a commit
to mnicolas94/SerializableCallback
that referenced
this issue
Sep 12, 2023
UnityEvent has support for common serialized types not inherited from UnityEngine.Object. By debugging the code, it seems that SerializableCallback has a validation method for parameters that checks if they are a value type and inherits from UnityEngine.Object, and returns invalid if they not.
So for feature parity with UnityEvent, SerializableCallback should support these custom types.
Example:
Add this Component to a GameObject, and try to select the dynamic method TestMethod from both the UnityEvent and the SerializableEvent. Only the UnityEvent will provide the option.
The text was updated successfully, but these errors were encountered: