-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyBlueprintFunctionLibrary.h
More file actions
68 lines (48 loc) · 1.34 KB
/
MyBlueprintFunctionLibrary.h
File metadata and controls
68 lines (48 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright Marcelo Coelho
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyBlueprintFunctionLibrary.generated.h"
class FJsonObject;
USTRUCT(BlueprintType)
struct FAqTestStruct
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString MyString;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
bool MyBool = true;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
int MyInt = 123;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
float MyFloat = 123.45f;
UPROPERTY()
FVector MyVector = {1.f, 2.f, 3.f};
UPROPERTY()
FRotator MyRotator = {1.f, 2.f, 3.f};
UPROPERTY()
TArray<int32> Enemies;
UPROPERTY()
FTransform MyTransform;
FString MyOtherString = "This is not available in Json";
};
/**
*
*/
UCLASS()
class SPAWNER_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable)
static FString ReadStringFromFile(FString FilePath, bool& bOutSuccess, FString& OutInfoMessage);
UFUNCTION(BlueprintCallable)
static FAqTestStruct ReadStructFromJsonFile(FString JsonFilePath, bool& bOutSuccess, FString& OutInfoMessage);
/**
* @param JsonFilePath
* @param bOutSuccess
* @param OutInfoMessage
*/
static TSharedPtr<FJsonObject> ReadJson(FString JsonFilePath, bool& bOutSuccess, FString& OutInfoMessage);
};