Files
PHY/Plugins/GCS/Source/GenericCombatSystem/Public/Bullet/GCS_BulletSystemComponent.h
2026-03-03 01:23:02 +08:00

52 lines
1.8 KiB
C++

// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GCS_BulletStructLibrary.h"
#include "Components/ActorComponent.h"
#include "GCS_BulletSystemComponent.generated.h"
/**
* @note WIP
*/
UCLASS(Abstract, ClassGroup=(GCS), meta=(BlueprintSpawnableComponent))
class GENERICCOMBATSYSTEM_API UGCS_BulletSystemComponent : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UGCS_BulletSystemComponent();
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
/**
* Gets the bullet system component from an actor.
* 从Actor获取子弹系统组件。
* @param Actor The actor to query. 要查询的Actor。
* @return The bullet system component. 子弹系统组件。
*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "GCS|BulletSystem", Meta = (DefaultToSelf="Actor"))
static UGCS_BulletSystemComponent* GetBulletSystemComponent(const AActor* Actor);
/**
* Finds the bullet system component on an actor.
* 在Actor上查找子弹系统组件。
* @param Actor The actor to query. 要查询的Actor。
* @param Component The found component (output). 找到的组件(输出)。
* @return True if found. 如果找到返回true。
*/
UFUNCTION(BlueprintCallable, Category = "GCS|BulletSystem", Meta = (DefaultToSelf="Actor", ExpandBoolAsExecs="ReturnValue"))
static bool FindBulletSystemComponent(const AActor* Actor, UGCS_BulletSystemComponent*& Component);
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "GCS|BulletSystem")
void SpawnBullet(const FGCS_BulletSpawnParameters& SpawnParameters);
// virtual TArray<AGCS_BulletInstance*> SpawnBulletInternal(const FGCS_BulletSpawnParameters& SpawnParameters);
};