示例#1
0
 protected virtual void Awake()
 {
     storedActionQueue = new Queue <GOAPAction>();
     actionQueue       = new Queue <GOAPAction>();
     Provider          = GetComponent <IGOAP>();
     Planner           = new GOAPPlanner();
     FSM        = new GOAPFSM();
     GraphAsset = GraphAsset.Clone() as GOAPGraphAsset;
     T_Graph.Initialize(this);
     Goals = Goals.OrderByDescending(goal => goal.Priority).ToList();
 }
示例#2
0
 protected virtual void Awake()
 {
     storedActionQueue = new Queue <GOAPAction>();
     actionQueue       = new Queue <GOAPAction>();
     Provider          = GetComponent <IGOAP>();
     Planner           = new GOAPPlanner();
     FSM = new GOAPFSM();
     AvailableActions = GetComponentsInChildren <GOAPAction>();
     foreach (var action in AvailableActions)
     {
         action.Initialize(this);
     }
     Goals = Goals.OrderByDescending(goal => goal.Priority).ToList();
 }
示例#3
0
 private IEnumerable <Goal> LastGoals(int goalsToGet)
 {
     return(Goals.OrderByDescending(g => g.Time).Take(goalsToGet));
 }