Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (ai_sensor.Get_Vision()) //if he see
     {
         Start_Vibing();
     }
     else if (!ai_sensor.Get_Vision())  //if we're vibin but we don't see the player
     {
         Stop_Vibing();
     }
 }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (ai_sensor.Get_Vision()) //if he see
        {
            Activate();
        }
        else  //if we're vibin but we don't see the player
        {
            Deactivate();
        }

        if (is_activated)
        {
            timer += Time.deltaTime;
            if (timer > shot_interval)
            {
                m_Animator.SetTrigger("Shoot");
                Invoke("Shoot", shot_delay);
                timer = 0;
            }
        }

        Face_Player();
        if (health <= 0)
        {
            Invoke("Die", 0.25f);
        }
    }