public void ProcessDeath() { WanderingAI behaviour = GetComponent <WanderingAI>(); behaviour.SetAlive(false); StartCoroutine(Die()); }
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()); }
public void ReactToHit() { if (behavior != null) { behavior.SetAlive(false); } StartCoroutine(Die()); }
public void ReactToHit() {//метод, вызванный сценарием стрельбы WanderingAI behavior = GetComponent <WanderingAI>(); if (behavior != null) { //проверяем, есть ли сценарий WanderingAI behavior.SetAlive(false); //вызываем метод SetAlive и меняем жизнь врага на false } StartCoroutine(Die()); //вызываем сопрограмму смерти врага }
public void ReactToHit() { WanderingAI behaviour = GetComponent <WanderingAI> (); if (behaviour != null) // if it has a WanderingAI script { behaviour.SetAlive(false); } StartCoroutine(Die()); }
public void ReactToHit() { WanderingAI ai = GetComponent <WanderingAI>(); if (ai != null) { ai.SetAlive(false); } StartCoroutine(Die()); }
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()); }
public void ReactToHit() // իրան կրակելու t կանչվող method․ { WanderingAI behavior = GetComponent <WanderingAI>(); if (behavior != null) // սաղ լինի, նոր սպանենք․ եթե սաղ չի, սատկացնել, նոր սպանել․ { behavior.SetAlive(false); } StartCoroutine(Die()); }
public void ReactToHit() {//метод, вызванный сценарием стрельбы WanderingAI behavior = GetComponent <WanderingAI>(); if (behavior != null) { //проверяем, есть ли сценарий WanderingAI behavior.SetAlive(false); //вызываем функцию SetAlive со значением false } StartCoroutine(Die()); //вызов сопрограммы }
public void ReactToHit() { WanderingAI behavior = GetComponent <WanderingAI>(); if (behavior != null) { behavior.SetAlive(false); } StartCoroutine(Die()); }
public void ReactToHit() { //Метод, вызванный сценарием стрельбы. WanderingAI behavior = GetComponent <WanderingAI>(); if (behavior != null) //<-Проверяем, присоединен ли к персонажу сценарий //WanderingAI; он может и отсутствовать { behavior.SetAlive(false); } StartCoroutine(Die()); }
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()); }
public void ReactToHit() { WanderingAI behavior = GetComponent <WanderingAI>(); if (behavior != null) { behavior.SetAlive(false); } animator.SetBool("isDead", true); }
// нанесение урона врагу public void ReactToHit() { if (!_enemy.getAlive()) { return; } _enemy.SetAlive(false); // компонент нужен для падения gameObject.AddComponent <Rigidbody>(); StartCoroutine(Die()); }
//вызывается сценарием стрельбы RayShooter public void ReactToHit() { WanderingAI behavior = GetComponent <WanderingAI>(); //проверка нужна т.к. он может и отсутствовать if (behavior != null) { behavior.SetAlive(false); } StartCoroutine(Die()); }
// 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()); }
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()); }
// 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 }
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()); } } }
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()); } }
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()); }