void InitCoverTrigger(CoverTrigger ct) { ct.triggerHandler = TriggerHandler; ct.triggerExitHandler = TriggerExitHandler; // Position the CoverTrigger at the coverTriggerDist ct.transform.localPosition = ct.transform.localPosition.normalized * coverTriggerDist; // Scale the SphereCollider radius to coverTriggerRadius ct.sphereCollider.radius = coverTriggerRadius; }
void TriggerExitHandler(CoverTrigger coverTrigger) { #if DEBUG_ThirdPersonTakeCoverAgainstWall_Triggers Debug.Log("ThirdPersonTakeCoverAgainstWall:TriggerExitHandler - Called by " + coverTrigger.name); #endif if (coverTrigger.coverNum != -1) { againstCover[coverTrigger.coverNum] = false; } }