/** * Run the action. * Returns True if the action performed successfully or false * if something happened and it can no longer perform. In this case * the action queue should clear out and the goal cannot be reached. */ public abstract bool Perform(GameObject agent, GoapMemory memory);
/** * This function checks the closest path from one action to another */ public virtual bool CheckDistance(GameObject obj, GoapMemory memory) { return(false); }
/** * Procedurally check if this action can run. Not all actions * will need this, but some might. */ public abstract bool CheckProceduralPrecondition(GameObject agent, GoapMemory memory);
protected override void Awake() { base.Awake(); goal.Set <float>(WorldStates.STATE_FLOAT_SATURATION, 1f); memory = GetComponent <GoapMemory>(); }
public void AddData(GoapMemory memory, string key, object value) { memory.AddData(key, value); }
public void AddWorldObjectsData(GoapMemory memory, string key, string objectType) { memory.AddWorldData(key, WorldData.GetData(objectType)); }