コード例 #1
0
        private void FixedUpdate()
        {
            if (currenActionStarted == null)
            {
                currenActionStarted = Time.time;
            }

            currentAction.Action();

            foreach (var current in currentAction.transitions)
            {
                var result = current.decision.Decide();

                if (result && current.toTrue != null)
                {
                    currenActionStarted = Time.time;
                    currentAction.ExitAction();
                    currentAction = current.toTrue;
                }
                else if (!result && current.toFalse != null)
                {
                    currenActionStarted = Time.time;
                    currentAction.ExitAction();
                    currentAction = current.toFalse;
                }
            }
        }
コード例 #2
0
 private void Awake()
 {
     if (initialAction != null)
     {
         currentAction = initialAction;
     }
 }