61 lines
1.0 KiB
C++
61 lines
1.0 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "DigHelpGI_Subsystem.h"
|
|
|
|
|
|
|
|
void UDigHelpGI_Subsystem::Initialize(FSubsystemCollectionBase& Collection)
|
|
{
|
|
Super::Initialize(Collection);
|
|
LoadConfig();
|
|
|
|
}
|
|
|
|
void UDigHelpGI_Subsystem::Deinitialize()
|
|
{
|
|
|
|
|
|
Super::Deinitialize();
|
|
}
|
|
|
|
bool UDigHelpGI_Subsystem::DoDig(int32& DigInNeed)
|
|
{
|
|
DigInNeed = --DigState.DigCount;
|
|
return DigInNeed <= 0;
|
|
}
|
|
|
|
bool UDigHelpGI_Subsystem::DoSweep(int32& SweepInNeed)
|
|
{
|
|
SweepInNeed = --DigState.SweepCount;
|
|
return SweepInNeed <= 0;
|
|
}
|
|
|
|
void UDigHelpGI_Subsystem::NotifyRestartGame()
|
|
{
|
|
DigState = FDigState();
|
|
ChuTuArray.Reset();
|
|
LayerData = nullptr;
|
|
|
|
LoadConfig();
|
|
UE_LOG(LogTemp, Warning, TEXT("============== UDigHelpGI_Subsystem:已重置引用 =============="));
|
|
}
|
|
|
|
void UDigHelpGI_Subsystem::RegisterChuTuArray(AActor* InActor)
|
|
{
|
|
if(IsValid(InActor))
|
|
{
|
|
ChuTuArray.Add(InActor);
|
|
}
|
|
}
|
|
|
|
void UDigHelpGI_Subsystem::RegisterLayerData(AActor* InActor)
|
|
{
|
|
if(IsValid(InActor))
|
|
{
|
|
LayerData = InActor;
|
|
}
|
|
}
|
|
|
|
|