Example #1
0
        private void _SetPlan()
        {
            // Set test plan
            _actionPlanner.PopulatePlan(_planTest, _state, _goal);
            // Check if test plan is not valid
            if (_planTest.Outcome != EPlanningOutcome.Success || _planTest.Steps.Count == 0)
            {
                // Set test plan
                _actionPlanner.PopulatePlan(_planTest, _actionDefault);
            }
            // Set plan
            _actionStateMachine.Plan = _planTest;
            // Get active plan
            var planActive = _planActive;

            // Set active plan
            _planActive = _planTest;
            // Set test plan
            _planTest = planActive;
        }
Example #2
0
 public Move(GameObject gameObject, IReadOnlyList <IDogActionMovement> actionsMovement, IDogActionDestination actionDestination)
 {
     // Set action planner
     _actionPlanner = new ActionPlanner <Dog, IDogActionMovement>();
     // Set action state machine
     _actionStateMachine = new ActionStateMachine <Dog, IDogActionMovement, float>();
     // Run through movement actions
     for (int i = 0; i < actionsMovement.Count; i++)
     {
         // Create movement action
         var actionMovement = actionsMovement[i].Create(gameObject, actionDestination);
         // Add movement action
         _actionPlanner.AddAction(actionMovement);
     }
     // Set destination action
     _actionDestination = actionDestination;
     // Get plan
     _plan = _actionPlanner.GetPlan();
     // Set plan
     _actionPlanner.PopulatePlan(_plan, _actionPlanner.Actions[0]);
 }