Exemplo n.º 1
0
        public override void Execute(object[] args)
        {
            Assert.That(args.IsEmpty());

#if UNITY_EDITOR && ZEN_PROFILING_ENABLED
            using (ProfileBlock.Start(_method.ToDebugString()))
#endif
            {
                _method();
            }
        }
Exemplo n.º 2
0
        public void Unlisten(System.Action listener)
        {
            bool success = _listeners.Remove(listener);

            if (!success)
            {
                throw Assert.CreateException(
                          "Tried to remove method '{0}' from signal '{1}' without adding it first", listener.ToDebugString(), this.GetType());
            }
        }
Exemplo n.º 3
0
 public void Listen(System.Action listener)
 {
     if (_listeners.Contains(listener))
     {
         throw Assert.CreateException(
                   "Tried to add method '{0}' to signal '{1}' but it has already been added", listener.ToDebugString(), this.GetType());
     }
     _listeners.Add(listener);
 }