// Update is called once per frame public void Run() { switch (GameState) { case GameStates.States.Starting: Starting.Invoke(); break; case GameStates.States.Loading: Loading.Invoke(); break; case GameStates.States.Playing: Playing.Invoke(); break; case GameStates.States.Dying: Dying.Invoke(); break; case GameStates.States.Ending: Ending.Invoke(); break; } }
protected override void Die() { Target.AddMoney(Reward); Dying?.Invoke(this); GetComponent <GoblinStateMachine>().ResetOnDie(); gameObject.SetActive(false); }
// Update is called once per frame public void Run() { switch (GameState) { case "Starting": Starting.Invoke(); break; case "Dying": Dying.Invoke(); break; case "Playing": Playing.Invoke(); break; case "Ending": Ending.Invoke(); break; case "Winning": Winning.Invoke(); break; } }
void RunStates() //Command will loop either state because switch is in update { switch (GameState) { case "Starting": Starting.Invoke(); break; //stop and get out of the switch block case "Loading": Loading.Invoke(); break; //stop and get out of the switch block case "Dying": Dying.Invoke(); break; //stop and get out of the switch block case "Playing": Playing.Invoke(); break; //stop and get out of the switch block case "Ending": Ending.Invoke(); break; //stop and get out of the switch block } }
public void TakeDamage(int damage) { _health -= damage; if (_health <= 0) { Dying?.Invoke(this); Destroy(gameObject); } }
public void TakeDamage(float damage) { _health -= damage; if (_health <= 0) { Dying?.Invoke(this); } }
public void TakeDamage(int damage) { _health -= damage; _animator.SetTrigger("Hit"); if (_health <= 0) { Dying?.Invoke(this); // передаем в событие спавнера экземпляр класса enemy } }
public void Takedamage(int damage) { _health -= damage; if (_health <= 0) { Dying?.Invoke(this); _animator.Play("Die"); Destroy(gameObject, .3f); } }
private void Die() { _isDying = true; _attackState.enabled = false; _moveState.enabled = false; _jumpState.enabled = false; Dying?.Invoke(this); _animator.Play("Die"); Destroy(gameObject, _dieTime); }
public void TakeDamage(int damage) { if (damage >= _health) { _health = 0; Dying?.Invoke(this); Destroy(gameObject); return; } _health -= damage; }
public void TakeDamage(int damage) { _animator.SetTrigger("TakeDamage"); _audioSource.Play(); _currentHealth -= damage; HealthChanged?.Invoke(_currentHealth, _health); if (_currentHealth <= 0) { Dying?.Invoke(this); StartCoroutine(EnemyDying(_audioSource.clip.length)); } }
public void Kill() { Dying?.Invoke(this); OnDying(); if (m_DeathAnimation != null) { m_DeathAnimation.Resume(); } else { die(); } }
//Player takes damage function void TakeDamage(int damage) { //change players health currentHealth -= damage; Debug.Log("Player took " + damage + " damage!"); //show change on health bar healthBar.SetHealth(currentHealth); if (currentHealth <= 0) { AudioHelper.PlayClip2D(_dying, .05f); Dying?.Invoke(); } }
protected override void Die() { Target.AddMoney(Reward); Dying?.Invoke(this); gameObject.SetActive(false); }
private void Die() { Dying?.Invoke((int)_elapsedLifeTime, _score); Time.timeScale = 0; }
private void Die() { Dying?.Invoke(); }
private void Die() { Dying?.Invoke(this, _healthReward); }
private void Die() { Dying?.Invoke(this); Destroy(gameObject); }
public void Die() { Dying?.Invoke(this); Instantiate(_deathEffect, transform.position, Quaternion.identity); Destroy(gameObject); }
protected override void Die() { Target.AddMoney(Reward); Dying?.Invoke(this); Destroy(gameObject); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { Dying?.Invoke(); }
/// <summary> /// метод при умирании /// </summary> public void Die() { Dying.Invoke(); // вызов метода из field }