Ejemplo n.º 1
0
 public Node(Node parent, float cost, StratusWorldState state, StatefulAction action)
 {
     Parent = parent;
     Cost   = cost;
     State  = state;
     Action = action;
 }
Ejemplo n.º 2
0
            private void OnEnable()
            {
                StatefulAction = target as StatefulAction;

                //BlackboardAsset = serializedObject.FindProperty("BlackboardAsset");
                Type = serializedObject.FindProperty("Type");

                Preconditions = serializedObject.FindProperty("Preconditions");
                Effects       = serializedObject.FindProperty("Effects");
                Cost          = serializedObject.FindProperty("Cost");
            }
Ejemplo n.º 3
0
            //------------------------------------------------------------------------/
            // Methods
            //------------------------------------------------------------------------/
            /// <summary>
            /// Executes the next action in the current plan
            /// </summary>
            public void ContinuePlan()
            {
                // If there's nothing actions left in the plan, reassess?
                if (CurrentPlan.IsFinished)
                {
                  this.Goal.Complete(this);
                  this.Agent.gameObject.Dispatch<Plan.ExecutedEvent>(new Plan.ExecutedEvent());
                  //if (Tracing) Trace.Script("The plan for " + this.CurrentGoal.Name + " has been fulfilled!", this);
                  //this.gameObject.Dispatch<Agent.>
                  return;
                }

                this.CurrentAction = CurrentPlan.Next();
                this.CurrentAction.Initialize(this.Agent);
            }
Ejemplo n.º 4
0
 /// <summary>
 /// Adds an action to the plan
 /// </summary>
 /// <param name="action"></param>
 public void Add(StatefulAction action)
 {
     Actions.AddLast(action);
 }