コード例 #1
0
        /// Execute the next action
        public void CompletedAction(ActionCompleteEvent item)
        {
            if (children.Any(x => x.action == item.action))
            { resolved += 1; }

            if (resolved == total)
            { actions.Complete(this); }
        }
コード例 #2
0
ファイル: Actions.cs プロジェクト: lzxkulou/unity-n-events
        /// Run when an action is complete
        public void Complete(IAction action, bool success = true)
        {
            var evp = new ActionCompleteEvent()
            {
                action = action
            };

            events.Trigger(evp);
        }
コード例 #3
0
        /// Execute the next action
        public void CompletedAction(ActionCompleteEvent item)
        {
            if (children.Any(x => x.action == item.action))
            {
                resolved += 1;
            }

            if (resolved == total)
            {
                actions.Complete(this);
            }
        }
コード例 #4
0
 /// Execute the next action
 public void NextAction(ActionCompleteEvent item)
 {
     if (children.Count > 0)
     {
         if ((item == null) || (currentAction == item.action))
         {
             currentAction = children.Dequeue();
             actions.Execute(currentAction, NextAction);
         }
     }
     else
     {
         actions.Complete(this);
     }
 }