public void Initialize(List <Character> list, UnityEngine.Events.UnityAction callback)
 {
     OnChangeCallbak.RemoveAllListeners();
     OnChangeCallbak.AddListener(callback);
     index  = 0;
     charas = list;
     SetData();
 }
예제 #2
0
 protected virtual void OnDestroy()
 {
     if (executeWhen.Equals(ExecuteWhen.DESTROY))
     {
         Execute();
     }
     actionToExecute.RemoveAllListeners();
     //If is not pooled object and must be executed on event i need to StopListening OnDestroy
     if (executeWhen.Equals(ExecuteWhen.EVENT) && !isPooledObject)
     {
         EventManager.StopListening(eventToListen, Execute);
     }
 }
예제 #3
0
 public static void AddListenerOnly(this UnityEngine.Events.UnityEvent unityEvent, UnityEngine.Events.UnityAction unityAction)
 {
     unityEvent.RemoveAllListeners();
     unityEvent.AddListener(unityAction);
 }