Exemple #1
0
        public DisableEvent(UnityEvent <T> evt, UnityAction <T> action)
        {
            this.evt   = evt;
            this.index = evt.IndexOf(action);

            Set(false);
            return;
        }
        public static void AddListenerIfNotExist <T>(this UnityEvent <T> evt, UnityAction <T> action)
        {
            if (evt.IndexOf(action) >= 0)
            {
                return;
            }

            UnityEventTools.AddPersistentListener(evt, action);
        }