コード例 #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;
    }
コード例 #3
0
 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
ファイル: ReactiveTarget.cs プロジェクト: Ehl7202/Camp12
    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
ファイル: ReactiveTarget.cs プロジェクト: SashaMaxim12/Live
    public void ReactToHit()
    {//метод, вызванный сценарием стрельбы
        WanderingAI behavior = GetComponent <WanderingAI>();

        if (behavior != null)
        {                             //проверяем, есть ли сценарий WanderingAI
            behavior.SetAlive(false); //вызываем функцию SetAlive со значением false
        }
        StartCoroutine(Die());        //вызов сопрограммы
    }
コード例 #12
0
ファイル: ReactiveTarget.cs プロジェクト: KurobinaXD/Game
    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());
    }
コード例 #21
0
    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());
    }