コード例 #1
0
 public void AddAction(Action <GameObject, object> action, object arg)
 {
     NotifyOnEvent.NotifyWithArg notifyWithArg = new NotifyOnEvent.NotifyWithArg();
     notifyWithArg.action = action;
     notifyWithArg.arg    = arg;
     this.m_actions.Add(notifyWithArg);
 }
コード例 #2
0
        protected void OnEvent()
        {
            if (NotifyOnEvent.Disable)
            {
                return;
            }
            int count = this.m_actions.Count;

            for (int i = 0; i < count; i++)
            {
                NotifyOnEvent.INotify notify = this.m_actions[i];
                if (notify is NotifyOnEvent.Notify)
                {
                    NotifyOnEvent.Notify notify2 = notify as NotifyOnEvent.Notify;
                    notify2.action(base.gameObject);
                }
                else if (notify is NotifyOnEvent.NotifyWithArg)
                {
                    NotifyOnEvent.NotifyWithArg notifyWithArg = notify as NotifyOnEvent.NotifyWithArg;
                    notifyWithArg.action(base.gameObject, notifyWithArg.arg);
                }
            }
        }