示例#1
0
 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));
 }
示例#2
0
    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);
        }
    }
示例#3
0
    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;
        }
    }