Oakfolks Gold_1.14
Oakfolks coop game
Loading...
Searching...
No Matches
UTriggerZone Class Reference

Dual-zone trigger component for player detection. More...

#include <TriggerZone.h>

Inheritance diagram for UTriggerZone:
Collaboration diagram for UTriggerZone:

Public Member Functions

 UTriggerZone ()
 Initializes the trigger zone component.
 
virtual void OnRegister () override
 Configures zones when component is registered.
 
virtual void BeginDestroy () override
 Cleans up component before destruction.
 
FORCEINLINE USphereComponent * GetInnerZoneComponent ()
 
FORCEINLINE USphereComponent * GetOuterZoneComponent ()
 

Protected Member Functions

void SetupZone (USphereComponent *ZoneComponent, const float ZoneSize, const FColor ZoneColor) const
 Configures a sphere zone with collision and visual properties.
 
void SetTriggerZoneSize (USphereComponent *ZoneComponent, const float NewZoneSize)
 Updates the radius of a trigger zone.
 
void OnActorEnterInnerZone (UPrimitiveComponent *OverlappedComp, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
 Handles player entering the inner trigger zone.
 
void OnActorExitInnerZone (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex)
 Handles player leaving the inner trigger zone.
 
void OnActorEnterOuterZone (UPrimitiveComponent *OverlappedComp, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
 Outer zone.
 
void OnActorExitOuterZone (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex)
 Handles player leaving the outer trigger zone.
 

Protected Attributes

USphereComponent * InnerZoneComponent
 
USphereComponent * OuterZoneComponent
 
float InnerZoneSize
 
float OuterZoneSize
 
TArray< AActor * > PlayersInInnerZone
 Player tracking.
 
TArray< AActor * > PlayersInOuterZone
 

Detailed Description

Dual-zone trigger component for player detection.

Manages inner and outer spherical trigger zones with player tracking and event broadcasting

Constructor & Destructor Documentation

◆ UTriggerZone()

UTriggerZone::UTriggerZone ( )

Initializes the trigger zone component.

Sets up inner and outer sphere components with collision callbacks

Here is the call graph for this function:

Member Function Documentation

◆ BeginDestroy()

void UTriggerZone::BeginDestroy ( )
overridevirtual

Cleans up component before destruction.

Removes collision event bindings to prevent crashes

Here is the call graph for this function:

◆ OnActorEnterInnerZone()

void UTriggerZone::OnActorEnterInnerZone ( UPrimitiveComponent * OverlappedComp,
AActor * OtherActor,
UPrimitiveComponent * OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult & SweepResult )
protected

Handles player entering the inner trigger zone.

EVENT CALLBACKS //////// Inner zone

Tracks players and notifies listeners about inner zone entry events

Parameters
OverlappedCompThe component that was overlapped
OtherActorThe actor that entered the zone
OtherCompThe component of the entering actor
OtherBodyIndexBody index of the collision
bFromSweepWhether this was from a sweep operation
SweepResultHit result from sweep if applicable
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnActorEnterOuterZone()

void UTriggerZone::OnActorEnterOuterZone ( UPrimitiveComponent * OverlappedComp,
AActor * OtherActor,
UPrimitiveComponent * OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult & SweepResult )
protected

Outer zone.

Handles player entering the outer trigger zone.

Tracks players and notifies listeners about outer zone entry events

Parameters
OverlappedCompThe component that was overlapped
OtherActorThe actor that entered the zone
OtherCompThe component of the entering actor
OtherBodyIndexBody index of the collision
bFromSweepWhether this was from a sweep operation
SweepResultHit result from sweep if applicable
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnActorExitInnerZone()

void UTriggerZone::OnActorExitInnerZone ( UPrimitiveComponent * OverlappedComponent,
AActor * OtherActor,
UPrimitiveComponent * OtherComp,
int32 OtherBodyIndex )
protected

Handles player leaving the inner trigger zone.

Removes players from tracking and notifies listeners when zone is empty

Parameters
OverlappedComponentThe component that was overlapped
OtherActorThe actor that left the zone
OtherCompThe component of the leaving actor
OtherBodyIndexBody index of the collision
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnActorExitOuterZone()

void UTriggerZone::OnActorExitOuterZone ( UPrimitiveComponent * OverlappedComponent,
AActor * OtherActor,
UPrimitiveComponent * OtherComp,
int32 OtherBodyIndex )
protected

Handles player leaving the outer trigger zone.

Removes players from tracking and notifies listeners when zone is empty

Parameters
OverlappedComponentThe component that was overlapped
OtherActorThe actor that left the zone
OtherCompThe component of the leaving actor
OtherBodyIndexBody index of the collision
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRegister()

void UTriggerZone::OnRegister ( )
overridevirtual

Configures zones when component is registered.

Sets zone sizes and visual properties during component initialization

Here is the call graph for this function:

◆ SetTriggerZoneSize()

void UTriggerZone::SetTriggerZoneSize ( USphereComponent * ZoneComponent,
const float NewZoneSize )
protected

Updates the radius of a trigger zone.

Safely resizes a zone component with validation

Parameters
ZoneComponentThe sphere component to resize
NewZoneSizeThe new radius for the zone
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupZone()

void UTriggerZone::SetupZone ( USphereComponent * ZoneComponent,
const float ZoneSize,
const FColor ZoneColor ) const
protected

Configures a sphere zone with collision and visual properties.

ZONE MANAGEMENT //////// Setup

Sets up collision profile, visibility, and color for zone visualization

Parameters
ZoneComponentThe sphere component to configure
ZoneSizeThe radius size for the zone
ZoneColorThe debug color for zone visualization
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ InnerZoneSize

float UTriggerZone::InnerZoneSize
protected

PROPERTIES //////// Configuration


The documentation for this class was generated from the following files: