Files
gh-743175724-agents-project…/plugins/game-development/skills/unreal-gameplay-framework.md
2025-11-29 09:37:28 +08:00

1.1 KiB

name, description, version
name description version
UE Gameplay框架 Actor、Pawn、GameMode核心类 1.0.0

Unreal Engine Gameplay Framework

Core Classes

  • AActor: Base class for placeable objects
  • APawn: Actors that can be possessed
  • ACharacter: Humanoid pawns with movement
  • APlayerController: Player input and control
  • AGameMode: Game rules and logic

Component Pattern

UCLASS()
class AMyCharacter : public ACharacter {
    GENERATED_BODY()

    UPROPERTY(VisibleAnywhere)
    UStaticMeshComponent* MeshComp;

    UPROPERTY(VisibleAnywhere)
    UBoxComponent* TriggerBox;

public:
    AMyCharacter() {
        MeshComp = CreateDefaultSubobject<UStaticMeshComponent>("Mesh");
        TriggerBox = CreateDefaultSubobject<UBoxComponent>("Trigger");
    }
};

Gameplay Ability System

  • Attributes and AttributeSets
  • GameplayEffects for buffs/debuffs
  • GameplayAbilities for skills
  • GameplayTasks for async operations

Best Practices

  • Use Blueprintable C++ classes
  • Leverage UProperty for reflection
  • Minimize Tick usage
  • Use Object Pooling for frequently spawned actors