public void StartAI() { SelectTarget(); sonarAgent.speed = movementSpeed; timer = chaseTimer; sonarAnim.SetBool("bShieldUp", true); sonarAnim.SetBool("bMoving", true); currentMode = sonarBehaviourModes.chasing; started = true; Invoke("StartWalkingSounds", Random.Range(0.0f, 0.25f)); }
void TickerSpawnStage() { timer -= Time.deltaTime; if (timer < (tickerSpawnTimer - tickerSpawnOffsetDelay) && bTickerSpawned == false) { bTickerSpawned = true; SpawnTicker(); } if (timer <= 0) { sonarAnim.SetBool("bSpawnTicker", false); timer = chargeUpTimer; StartCoroutine(RemoveShield(true, shieldInTimer)); projectileBeam.enabled = true; currentMode = sonarBehaviourModes.charging; sonarChargeSound.PlayOneShot(sonarChargeSound.clip); } }
void Chase() { if (!currentTarget) { enemyTargetSelectionType = AttackType.Closest; SelectTarget(); } sonarAgent.destination = currentTarget.transform.position; timer -= Time.deltaTime; if (timer <= 0) { sonarAnim.SetBool("bMoving", false); timer = tickerSpawnTimer; sonarAgent.enabled = false; bTickerSpawned = false; sonarAnim.SetBool("bSpawnTicker", true); currentMode = sonarBehaviourModes.tickerSpawn; } }