IEnumerator HitSound() { sound = false; GetHit.Play(); if (!death) { demon_m.ani.SetTrigger("Hit"); } yield return(new WaitForSeconds(1f)); sound = true; }
IEnumerator HitSound() { sound = false; if (!death && !demon_m.isSkill && Exit) { GetHit.Play(); demon_m.ani.SetTrigger("Hit"); } yield return(new WaitForSeconds(1f)); sound = true; }
private float _moveSpeed = 5; //移動速度 // Start is called before the first frame update void Start() { _sprite = transform.Find("Sprite").gameObject; _getHitObj = GetComponent <GetHit>(); _rb = GetComponent <Rigidbody2D>(); _health = _sprite.GetComponent <Health>(); var wsize = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height)); _stateMachine = new StateMachine <Enemy>(); _stateMachine.Setup(this, new EnemySpawnDelay()); if (_multiAttackPattern) { _sprite.GetComponent <Animator>().SetBool("Multi Attack Pattern", true); } if (_unstunnable) { _sprite.GetComponent <Animator>().SetBool("Unstunnable", true); } _colliderBox = _sprite.GetComponent <Collider2D>().bounds.size; }
public virtual void OnGetHit(CombatEvent combatEvent) => GetHit?.Invoke(combatEvent);