public UnityEventWatcher(Component component, string eventName, Action action)
 {
     this.component        = component;
     this.eventName        = eventName;
     this.action           = action;
     this.unityEventBinder = UnityEventBinderFactory.Create(GetBoundEvent(eventName, component).UnityEvent, action);
 }
Beispiel #2
0
        public UnityEventWatcher(Component component, string eventName, Action action)
        {
            Assert.IsNotNull(component);
            Assert.IsFalse(string.IsNullOrEmpty(eventName));
            Assert.IsNotNull(action);

            unityEventBinder = UnityEventBinderFactory.Create(GetBoundEvent(eventName, component).UnityEvent, action);
        }
Beispiel #3
0
 public void Dispose()
 {
     if (unityEventBinder != null)
     {
         unityEventBinder.Dispose();
         unityEventBinder = null;
     }
 }
Beispiel #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing && unityEventBinder != null)
            {
                unityEventBinder.Dispose();
                unityEventBinder = null;
            }

            disposed = true;
        }
Beispiel #5
0
 public UnityEventWatcher(Component component, string eventName, Action action)
 {
     unityEventBinder = UnityEventBinderFactory.Create(GetBoundEvent(eventName, component).UnityEvent, action);
 }