Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (count)
     {
         timer -= Time.deltaTime;
         if (timer <= 0f)
         {
             counter++;
             count = false;
             timer = 1f;
             if (counter >= 2)
             {
                 manager.Abilities(index);
                 counter = 0;
             }
         }
     }
     else
     {
         timer = 1.0f;
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (!player)
        {
            player = GameObject.Find("Player");
        }

        if (seePlayer)
        {
            followTimer -= Time.deltaTime;
            if (followTimer <= 0f)
            {
                manager.Abilities(7); //if following long enough, unlock that ability
                FollowingAbility();
                followTimerStandard++;
                followTimer = followTimerStandard; //make it take longer to advance next time
            }
        }
        else
        {
            followTimer = followTimerStandard;
        }
    }