void OnTriggerEnter(Collider collider) { if (!_isAttacking) { return; } Bug bug = collider.GetComponent <Bug>() ?? collider.GetComponentInChildren <Bug>() ?? collider.GetComponentInParent <Bug>(); if (bug != null) { _nbKill++; BugManager.KillBug(bug); Debug.Log("KillingSpree !!! : " + bug); } if (collider.gameObject.layer == 9) { _StopAttack(); } }