ULimenGameMenuWidget
Overview
ULimenGameMenuWidget is an abstract, blueprintable class derived from ULimenMenuWidget. It manages the binding of a player controller and updates its state when the possessed pawn changes. This widget provides functionality for getting the bound pawn and handling pawn possession events.
Properties
Type | Name | Access | Description |
|---|---|---|---|
TWeakObjectPtr | BoundPawn | Private | A weak pointer to the currently bound pawn. |
TWeakObjectPtr | BoundPlayerController | Private | A weak pointer to the player controller that is bound to this widget. |
Functions
Return Type | Signature | Description |
|---|---|---|
void | BindPlayerController(APlayerController* InPlayerController) | Binds the specified player controller to this widget and sets up event handlers for pawn possession changes. |
APawn* | GetBoundPawn() const | Returns the currently bound pawn. |
void | PawnBoundUpdated(APawn* NewPawn) | A native event that is called when the bound pawn updates. This function can be overridden in blueprints to handle custom logic. |
Usage & Implementation Notes
Threading Constraints: This widget operates on the game thread and should not perform any operations that could block or delay gameplay.
Replication Requirements: None.
Memory Lifetime Management: The
BoundPawnandBoundPlayerControllerare managed using weak pointers to avoid memory leaks. Ensure that the player controller and pawn exist for the lifetime of this widget.Initialization Dependencies: This widget requires a valid player controller to be bound before it can function correctly.