Example #1
0
 public virtual void UnSubscribe <T>(T _object, Action <T> _callback)
 {
     T1MatchCache.Clear();
     T1MatchCache = GetMatch(_object, out int ind);
     if (!T1MatchCache.IsEmpty)
     {
         T1Callbacks.RemoveAt(ind);
     }
 }
Example #2
0
 //T1
 public virtual void Subscribe <T>(T _object, Action <T> _callback) where T : class
 {
     T1MatchCache.Clear();
     T1MatchCache = GetMatch(_object, out int ind);
     if (T1MatchCache.IsEmpty)
     {
         T1MatchCache.objectValue = _object;
         T1MatchCache.action      = arg => _callback(arg as T);
         T1Callbacks.Add(T1MatchCache.Copy());
     }
 }
Example #3
0
        public void UnSubscribe <T>(T _object, System.Action <T> _onFinishedCallback) where T : class
        {
            T1Cache.Clear();
            T1Cache = GetMatch(_object, out int ind);
            if (!T1Cache.IsEmpty)
            {
                finishedCallbacks.RemoveAt(ind);
            }

            //unsub from condition as well
            finishedCondition.UnSubscribe(OnFinished);
        }