/// <summary> /// Enable the hit boxes for the given action /// </summary> public void EnableHitBoxes(Action action) { // If the given action is null, ignore this call if (action == null) { return; } // Cycle through each hit box belonging to the given action for (int i = 0; i < action.hitBoxes.Length; i++) { HitBox hitBoxInfo = action.hitBoxes[i]; // Enable the hit boxes hitBoxInfo.Enable(); } }
virtual public void Attack() { if (animator != null) { animator.Play("Base Layer.PLAYER_ATTACK"); } attackSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject)); attackSound.start(); if (attackHitBox != null) { attackHitBox.Enable(); } else { Debug.LogError("When perform attacks, a children gameObject with HitBox script is required"); } }