0
点赞
收藏
分享

微信扫一扫

UE4 C++事件的定义

Spinach菠菜 2022-02-24 阅读 90

UE4 C++的函数和事件的定义
在这里插入图片描述

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "SpwanVolume.generated.h"

UCLASS()
class GETSTARTED_API ASpwanVolume : public AActor
{
	GENERATED_BODY()

public:
	// Sets default values for this actor's properties
	ASpwanVolume();

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
	class UBoxComponent* SpawnBox;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Spawn Volume")
	TArray<TSubclassOf<AActor>> SpawnActorClassesArray;//TSubclassOf 一个模板类

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	UFUNCTION(BlueprintCallable, Category = "Spawn Volume")
	FVector GetSpawnPoint();

	UFUNCTION(BlueprintCallable, Category = "Spawn Volume")
	TSubclassOf<AActor> GetSpwnActorClass();


	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Spawn Volume")
	void SpawnActor();

};

举报

相关推荐

UE4 C++与UMG

UE4 动画

UE4问题

UE4 PixelStreamingDemo 验证

ue4无法编译

UE4 UI记录

UE4简易QTE

0 条评论