Пример #1
0
    public void ProcessDeath()
    {
        WanderingAI behaviour = GetComponent <WanderingAI>();

        behaviour.SetAlive(false);
        StartCoroutine(Die());
    }
Пример #2
0
    public void reactToHit()
    {
        // added after WanderingAI

        if (_alive)
        {
            audioSource.PlayOneShot(dieSound);

            WanderingAI behavior = GetComponent <WanderingAI>();
            if (behavior != null)
            {
                behavior.SetAlive(false);
            }

            Rigidbody body = GetComponent <Rigidbody> ();
            if (body != null)
            {
                body.freezeRotation = false;
            }


            StartCoroutine(Die());
        }

        _alive = false;
    }
 public void ReactToHit()
 {
     if (wanderingAI != null)
     {
         wanderingAI.SetAlive(false);
     }
     StartCoroutine(Die());
 }
Пример #4
0
 public void ReactToHit()
 {
     if (behavior != null)
     {
         behavior.SetAlive(false);
     }
     StartCoroutine(Die());
 }
Пример #5
0
    public void ReactToHit()
    {//метод, вызванный сценарием стрельбы
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {                             //проверяем, есть ли сценарий WanderingAI
            behavior.SetAlive(false); //вызываем метод SetAlive и меняем жизнь врага на false
        }
        StartCoroutine(Die());        //вызываем сопрограмму смерти врага
    }
Пример #6
0
    public void ReactToHit()
    {
        WanderingAI behaviour = GetComponent <WanderingAI> ();

        if (behaviour != null)           // if it has a WanderingAI script
        {
            behaviour.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #7
0
    public void ReactToHit()
    {
        WanderingAI ai = GetComponent <WanderingAI>();

        if (ai != null)
        {
            ai.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #8
0
    public void ReactToHit()                                 //método para matar o inimigo
    {
        WanderingAI behavior = GetComponent <WanderingAI>(); //checa se o objeto tem o script atrelado a ele

        if (behavior != null)
        {
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
    public void ReactToHit()
    {//метод, вызванный сценарием стрельбы
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {//проверяем, есть ли сценарий WanderingAI
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #10
0
    public void ReactToHit()   // իրան կրակելու t կանչվող method․
    {
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)   // սաղ լինի, նոր սպանենք․ եթե սաղ չի, սատկացնել, նոր սպանել․
        {
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #11
0
    public void ReactToHit()
    {//метод, вызванный сценарием стрельбы
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {                             //проверяем, есть ли сценарий WanderingAI
            behavior.SetAlive(false); //вызываем функцию SetAlive со значением false
        }
        StartCoroutine(Die());        //вызов сопрограммы
    }
Пример #12
0
    public void ReactToHit()
    {
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #13
0
    public void ReactToHit()
    { //Метод, вызванный сценарием стрельбы.
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null) //<-Проверяем, присоединен ли к персонажу сценарий
                              //WanderingAI; он может и отсутствовать
        {
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #14
0
    public void ReactToHit()
    {
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {
            //check if this character has a WanderingAI script; it may not
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #15
0
    public void ReactToHit()
    {
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {
            behavior.SetAlive(false);
        }

        animator.SetBool("isDead", true);
    }
Пример #16
0
 // нанесение урона врагу
 public void ReactToHit()
 {
     if (!_enemy.getAlive())
     {
         return;
     }
     _enemy.SetAlive(false);
     // компонент нужен для падения
     gameObject.AddComponent <Rigidbody>();
     StartCoroutine(Die());
 }
Пример #17
0
    //вызывается сценарием стрельбы RayShooter
    public void ReactToHit()
    {
        WanderingAI behavior = GetComponent <WanderingAI>();

        //проверка нужна т.к. он может и отсутствовать
        if (behavior != null)
        {
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #18
0
    // Method called by the shooting script
    public void ReactToHit()
    {
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {
            // Set the target state to false to indicate the target's current state is dead
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
Пример #19
0
    public void ReactToHit()
    {
        WanderingAI behavior = GetComponent <WanderingAI>();

        // Telling WanderingAI that this object has died so it cna stopped it's behavior
        if (behavior != null)
        {
            behavior.SetAlive(false);
        }

        StartCoroutine(Die());
    }
Пример #20
0
    // React to being hit. Called by shooting script.
    public void ReactToHit()
    {
        // Check if character has a WanderingAI script - it might not.
        WanderingAI behavior = GetComponent <WanderingAI>();

        // Set char as "dead" so it will stop wandering.
        if (behavior != null)
        {
            behavior.SetAlive(false);
        }
        StartCoroutine(Die());
    }
    public void ReactToHit()
    {
        // Get the Wandering AI component script
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {
            // if shot, turn the alive bool to false to stop movement
            behavior.SetAlive(false);
        }
        StartCoroutine(Die()); // coroutines are similar to interrupts
    }
Пример #22
0
    public void ReactToHit()
    {
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {
            enemyHealth -= 1;
            _animator.SetInteger("enemyHealth", enemyHealth);
            //Debug.Log("The enemyHealth: " + enemyHealth);
            if (enemyHealth == 0)
            {
                behavior.SetAlive(false);
                StartCoroutine(Die());
            }
        }
    }
Пример #23
0
    public void ReactToHit()
    {
        WanderingAI behavior  = GetComponent <WanderingAI>();
        enemy2      behavior2 = GetComponent <enemy2>();

        _animator = this.GetComponent <Animator> ();
        if (behavior != null)
        {
            behavior.SetAlive(false);
            StartCoroutine(Die());
        }
        else if (behavior2 != null)
        {
            behavior2.SetAlive(false);
            StartCoroutine(Die());
        }
    }
Пример #24
0
    public void Death()
    {
        WanderingAI       behavior     = GetComponent <WanderingAI> ();
        StationaryShooter behavior2    = GetComponent <StationaryShooter> ();
        BossAI            bossBehavior = GetComponent <BossAI> ();

        if (behavior != null)
        {
            behavior.SetAlive(false);
            animator.SetTrigger("Death");
        }
        if (behavior2 != null)
        {
            animator.SetTrigger("Death");
        }
        if (bossBehavior != null)
        {
            bossBehavior.enabled = false;
            animator.SetBool("Walk Forward", false);
            animator.SetTrigger("Die");
        }
        StartCoroutine(Die());
    }