예제 #1
0
        public void Handle(UnityEngine.Object rTargetGo, EventTriggerType rEventType)
        {
            EventTypeObject rEventObject = null;

            if (this.mEvents.TryGetValue(rTargetGo, out rEventObject))
            {
                rEventObject.Handle(rEventType);
            }
        }
예제 #2
0
        public void RemoveOne(UnityEngine.Object rObj)
        {
            EventTypeObject rEventObject = null;

            if (this.mEvents.TryGetValue(rObj, out rEventObject))
            {
                rEventObject.Dispose();
                this.mEvents.Remove(rObj);
            }
        }
예제 #3
0
        public void UnBinding(UnityEngine.Object rTargetGo, HEventTriggerType rEventType, System.Action <UnityEngine.Object> rEventHandler)
        {
            EventTypeObject rEventObject = null;

            if (this.mEvents.TryGetValue(rTargetGo, out rEventObject))
            {
                rEventObject.RemoveEvent(rEventType, rEventHandler);
            }
            if (rEventObject != null && rEventObject.ReferCount == 0)
            {
                rEventObject.Dispose();
                this.mEvents.Remove(rTargetGo);
            }
        }
예제 #4
0
        public void Binding(UnityEngine.Object rTargetGo, HEventTriggerType rEventType, System.Action <UnityEngine.Object> rEventHandler)
        {
            EventTypeObject rEventObject = null;

            if (!this.mEvents.TryGetValue(rTargetGo, out rEventObject))
            {
                rEventObject = new EventTypeObject(rTargetGo);
                rEventObject.AddEvent(rEventType, rEventHandler);
                mEvents.Add(rTargetGo, rEventObject);
            }
            else
            {
                rEventObject.AddEvent(rEventType, rEventHandler);
            }
        }