public bool FindAction(FarmDigimonAI.ActionID action) { for (int i = 0; i < this.farmDigimons.Length; i++) { if (this.farmDigimons[i].ActionID == action) { return(true); } } return(false); }
private IEnumerator Thinking() { FarmDigimonAI.ActionID actionID = this.farmDigimonAI.ChooseAction(); while (this.manager.FindAction(actionID)) { yield return(new WaitForSeconds(2f)); actionID = this.farmDigimonAI.ChooseAction(); } this.farmDigimonAI.CreateActionParam(actionID); this.actionState = FarmDigimon.ActionState.ACT; yield break; }
public void CreateActionParam(FarmDigimonAI.ActionID actionID) { switch (actionID) { case FarmDigimonAI.ActionID.MEAT_FARM: this.actionParam.targetGridIndex = this.GetMeatFarmAroundGridIndex(); break; case FarmDigimonAI.ActionID.STROLL: case FarmDigimonAI.ActionID.STROLL_FAST: this.actionParam.targetGridIndex = FarmDigimonUtility.GetPassableGridIndex(); break; case FarmDigimonAI.ActionID.CONSTRUCTION: this.actionParam.targetGridIndex = this.GetConstructionAroundGridIndex(); break; } this.actionParam.actionID = actionID; if (this.actionParam.targetGridIndex != -1) { this.actionParam.pathGridIndexs = this.GetPassGridIndexs(this.actionParam.targetGridIndex); } }