private void ResetHitDetection() { if (_hitDetection) { _hitDetection.OnRaycastHitStop(); _hitDetection = null; } }
private void ManageCharacterHit(RaycastHit hitCharacter) { var hitObject = hitCharacter.collider.gameObject; _hitDetection = hitObject.GetComponent <RaycastHitDetection>(); if (_hitDetection) { _hitDetection.OnRaycastHit(); } }