Beispiel #1
0
 void Update()
 {
     if (isSinking)
     {
         timer += Time.deltaTime;
         if (timer > 1)
         {
             transform.Translate(-Vector3.up * sinkSpeed * Time.deltaTime);
         }
     }
     else
     {
         provjera = actEff.RetrieveEffect(1);
         if (provjera == 1)
         {
             effectTimer += Time.deltaTime;
             if (effectTimer <= 2)
             {
                 nav.speed = (float)(pocBrz * 0.3);
             }
             if (effectTimer > 2)
             {
                 nav.speed   = pocBrz;
                 effectTimer = 0f;
                 actEff.SetEffect(0, 1);
             }
         }
     }
 }
Beispiel #2
0
    void Update()
    {
        timer       += Time.deltaTime;
        cHealth      = playerHealth.RetrieveCurrentHP();
        provjeraStun = actEff.RetrieveEffect(2);
        if (enemyHealth.currentHealth > 0 && cHealth > 0)
        {
            if (provjeraStun == 0)
            {
                nav.SetDestination(player.position);
            }
            else
            {
                nav.enabled = false;
                timer       = 0f;
            }

            if (provjeraStun == 0 && nav.enabled == false && timer > 2)
            {
                nav.SetDestination(player.position);
                actEff.SetEffect(0, 2);
            }
        }
        else
        {
            nav.enabled = false;
        }
    }