子系统的5个父类
【UE4 C++】编程子系统 Subsystem_ue4 子系统_ttod的博客-CSDN博客
这个人写的很好!
来个简单是示例:
// Fill out your copyright notice in the Description page of Project Settings.
#include "HCGameInstanceSubsystem.h"
void UHCGameInstanceSubsystem::PrintfHello()
{
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, L"HELLO");
}
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "HCGameInstanceSubsystem.generated.h"
/**
*
*/
UCLASS()
class MYPROJECT_API UHCGameInstanceSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable)
void PrintfHello();
};