private void Simulation(int option) { switch (option) { case 1: if (this.tag == Tags.BlueTeam) { _agentActions.MoveTo(GameObject.Find(Names.RedFlag).transform.position); } else if (this.tag == Tags.RedTeam) { _agentActions.MoveTo(GameObject.Find(Names.BlueFlag).transform.position); } break; case 2: _agentActions.MoveTo(_agentData.FriendlyBase); break; case 3: _agentActions.MoveTo(_agentSenses.GetObjectInViewByName(Names.HealthKit)); break; case 4: _agentActions.MoveTo(_agentSenses.GetObjectInViewByName(Names.PowerUp)); break; case 5: _agentActions.MoveToRandomLocation(); break; case 6: if (this.tag == Tags.BlueTeam) { _agentActions.MoveTo(_agentSenses.GetObjectInViewByName(Names.BlueFlag)); } else if (this.tag == Tags.RedTeam) { _agentActions.MoveTo(_agentSenses.GetObjectInViewByName(Names.RedFlag)); } break; default: break; } }
protected override IEnumerator Execute() { SetState(NodeState.RUNNING); actions.MoveToRandomLocation(); SetState(NodeState.SUCCESS); yield return(null); }