Hello everyone, I would like to ask a question about a problem that I have encountered. Here it is :
I declared an delegate (just like as the unreal documents says how to declare) but unreal engine does not recognize the delegate. I mean it see and don’t see at the same tame. I can use every property and function of the delegate in the code itself(without and error or red things) but when I compile it unreal gives an error. Here is the photos of the code that causes the error and the compile error.
This code were working until I changed the location of two structures that I have defined in some folder to new folder. I did include the new file to the file but it didn’t make any difference.
Here is the file that I have just mentioned above
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/ObjectLibrary.h"
#include "StructureLibrary.generated.h"
USTRUCT()
struct FDoOnce
{
GENERATED_BODY()
public:
FORCEINLINE bool Do()
{
if (!bHasBeenInited)
{
bHasBeenInited = true;
return true;
}
return false;
}
FORCEINLINE void Reset() { bHasBeenInited = false; }
private:
UPROPERTY()
bool bHasBeenInited = false;
};
USTRUCT()
struct FGate
{
GENERATED_BODY()
public:
FORCEINLINE bool CanPassThrough() { return bIsGateOpen ? true : false; }
FORCEINLINE void OpenGate() { bIsGateOpen = true; }
FORCEINLINE void CloseGate() { bIsGateOpen = false; }
private:
UPROPERTY()
bool bIsGateOpen = false;
};
/**
*
*/
UCLASS()
class CDC_API UStructureLibrary : public UObjectLibrary
{
GENERATED_BODY()
};