private void Update() { curTarget = findNewTarget; while (curTarget.MakeDecision() != null) { curTarget = curTarget.MakeDecision(); } }
private void Update() { totalBunnies = GameObject.FindGameObjectsWithTag("Bunny"); for (int i = 0; i < totalBunnies.Length; i++) { if (!totalBunnies[i].GetComponent <BunnyAI>().healthyBunny) { infectionMark++; } } if (infectionMark != totalBunnies.Length) { infectionMark = 0; currentDecision = BunnyAi; while (currentDecision != null) { currentDecision = currentDecision.MakeDecision(); } } else { SceneManager.LoadScene("gameover"); } }
// Every frame makes a decision on what to do; private void Update() { curDec = enemCheck; while (curDec != null) { curDec = curDec.MakeDecision(); } }
void Update() { IDecision currentDecision = decisionTreeRoot; while (currentDecision != null) { decisionTreeRoot.MakeDecision(); } }
public override void RunTree(AIAgent agent) { Update(agent); IDecision current = start; while (null != current) { current = current.MakeDecision(); } }
// Update is called once per frame void Update() { //decisionTreeRoot.MakeDecision(); IDecision currentDecision = decisionTreeRoot; while (currentDecision != null) { currentDecision = currentDecision.MakeDecision(); } //decisionTreeRoot = new PrintDecision(true); }
void Update() { if (startNode != null) { currentNode = startNode; while (currentNode != null) { currentNode.MakeDecision(); currentNode = currentNode.GetNode(); } } }
void Update() { // On update, set the current to the root. currentDecision = decisionTreeRoot; // keep going through the tree until you hit null. null will be at the end // of a final decision (like the leaf of a tree). while (currentDecision != null) { currentDecision = currentDecision.MakeDecision(); } }
void Start() { // var first = new FirstDecision(); // var botch = new Chaser(); FirstDecision first = new FirstDecision(); IDecision test = first; while (test != null) { test = test.MakeDecision(); } }
public abstract void Update(AIAgent agent); // update values /// <summary> /// make decision /// </summary> /// <param name="agent">the agent to act upon</param> public void RunTree(AIAgent agent) { if (PauseState.Instance.Paused) { return; } current = start; while (null != current) { current = current.MakeDecision(); } }
private void Update() { AssassinAI = new DoISeePlayer( new IsPlayerInBush( new WanderAround(this), new AmICloseToPlayer( new AttackPlayer(this), new ChasePlayer(this), this), this), new WanderAround(this), this); currentDecision = AssassinAI; while (currentDecision != null) { currentDecision = currentDecision.MakeDecision(); } }
void Update() { if (stayingInBush == true) { if (timeBtwHits <= 0) { stayingInBush = false; timeBtwHits = startTimeBtwHits; } else { timeBtwHits -= Time.deltaTime; } } if (wandererHealth > 0 && stayingInBush == false) // if wanderer has health, then it's alive { WandererAI = new DoISeeEnemy( new AmIInBush( new StayInBush(this), new DoISeeBush( new HideInBush(this), new Panic(this), this), this), new ContinuePath(this), this); currentDecision = WandererAI; while (currentDecision != null) { currentDecision = currentDecision.MakeDecision(); } } else if (wandererHealth <= 0) { Destroy(gameObject); } }
// Update is called once per frame void FixedUpdate() { seesPlayer.MakeDecision(); }
public IDecision MakeDecision() { flee.MakeDecision(); return(flee); }
public IDecision MakeDecision() { return(Value ? trueBranch.MakeDecision() : falseBranch.MakeDecision()); }
void Start() { decisionTreeRoot = new PrintDecision(true); decisionTreeRoot.MakeDecision(); }