-
Notifications
You must be signed in to change notification settings - Fork 4
Home
zilch edited this page Sep 19, 2020
·
2 revisions
Write a script as follow, and add it to gameObject.
public class SerializableEventExample : MonoBehaviour
{
static SerializableEventExample(){
//EnsureCall is required both in Editor&Runtime
CachedCallArguementsTypeRegister.EnsureCall<string,Rect>();
CachedCallArguementsTypeRegister.EnsureCall<Transform,Vector2,bool>();
}
public SerializableEvent myEvent;
public void RunVoid(){}
public void RunInt(int number){}
public void RunStringRect(string name,Rect rect){}
public void RunObjectVector2Bool(Transform target,Vector2 position,bool immediately){}
}
Editor inspector will display like :

Then, add different callbacks:
