//OnTriggerEnter private void OnTriggerEnter2D(Collider2D collision) { if (is_Damaged) { return; } foreach (string tag in damaged_Tag_List) { if (collision.tag == tag) { player_Damaged.StartCoroutine("Damaged"); is_Damaged = true; } } //Miss時 if (collision.tag == "MissZoneTag") { player_Damaged.Miss(); } }
private void OnTriggerStay2D(Collider2D collision) { foreach (string tag in tag_List) { if (collision.tag == tag) { time += Time.deltaTime; } } if (time >= 0.05f) { time = 0; player_Damaged.StartCoroutine("Damaged"); } }