void OnTriggerEnter2D(Collider2D collision) { if (hitIds.FindIndex(id => id == collision.gameObject.GetInstanceID()) == -1) { hitIds.Add(collision.gameObject.GetInstanceID()); commandPunch.Hit(collision.gameObject); } }
void OnTriggerEnter2D(Collider2D collision) { commandPunch.Hit(collision.gameObject); }