Commit 3bda5499 by Kai Westerkamp

json parsen

parent a0e972c5
...@@ -67,7 +67,7 @@ bOffsetPlayerGamepadIds=False ...@@ -67,7 +67,7 @@ bOffsetPlayerGamepadIds=False
GameInstanceClass=/Script/Engine.GameInstance GameInstanceClass=/Script/Engine.GameInstance
GameDefaultMap=/Game/MobileStarterContent/Maps/Minimal_Default.Minimal_Default GameDefaultMap=/Game/MobileStarterContent/Maps/Minimal_Default.Minimal_Default
ServerDefaultMap=/Engine/Maps/Entry.Entry ServerDefaultMap=/Engine/Maps/Entry.Entry
GlobalDefaultGameMode=/Script/MasterTestProject.MasterTestProjectGameMode GlobalDefaultGameMode=/Script/MasterTestProject.MasterTestProjectGameModeBase
GlobalDefaultServerGameMode=None GlobalDefaultServerGameMode=None
[/Script/HardwareTargeting.HardwareTargetingSettings] [/Script/HardwareTargeting.HardwareTargetingSettings]
...@@ -76,4 +76,3 @@ AppliedTargetedHardwareClass=Mobile ...@@ -76,4 +76,3 @@ AppliedTargetedHardwareClass=Mobile
DefaultGraphicsPerformance=Scalable DefaultGraphicsPerformance=Scalable
AppliedDefaultGraphicsPerformance=Scalable AppliedDefaultGraphicsPerformance=Scalable
...@@ -20,7 +20,7 @@ public class MasterTestProject : ModuleRules ...@@ -20,7 +20,7 @@ public class MasterTestProject : ModuleRules
public MasterTestProject(TargetInfo Target) public MasterTestProject(TargetInfo Target)
{ {
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ImageWrapper", "RawMesh", "ProceduralMeshComponent" }); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ImageWrapper", "RawMesh", "Json", "ProceduralMeshComponent" });
PrivateDependencyModuleNames.AddRange(new string[] { }); PrivateDependencyModuleNames.AddRange(new string[] { });
......
// Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
#include "MasterTestProject.h" #include "MasterTestProject.h"
#include "JsonReader.h"
#include "MasterTestProjectGameModeBase.h" #include "MasterTestProjectGameModeBase.h"
void AMasterTestProjectGameModeBase::InitGame(const FString & MapName, const FString & Options, FString & ErrorMessage) {
Super::InitGame(MapName, Options, ErrorMessage);
FString file = "D:\\Dropbox\\Studium\\MasterArbeit\\3d-tiles\\examples\\tileset.json";
FString JsonRaw = "";
FFileHelper::LoadFileToString(JsonRaw, *file);
UE_LOG(GLTF, Log, TEXT("Loading file %s"), *file);
//UE_LOG(GLTF, Warning, TEXT("LangFile: \n %s"), *JsonRaw);
TSharedPtr<FJsonObject> JsonParsed;
TSharedRef<TJsonReader<TCHAR>> JsonReader = TJsonReaderFactory<TCHAR>::Create(JsonRaw);
if (FJsonSerializer::Deserialize(JsonReader, JsonParsed))
{
FString ExampleString = JsonParsed->GetStringField("geometricError");
UE_LOG(GLTF, Warning, TEXT("Example: \n %s"), *ExampleString);
}
}
...@@ -14,6 +14,8 @@ class MASTERTESTPROJECT_API AMasterTestProjectGameModeBase : public AGameModeBas ...@@ -14,6 +14,8 @@ class MASTERTESTPROJECT_API AMasterTestProjectGameModeBase : public AGameModeBas
{ {
GENERATED_BODY() GENERATED_BODY()
public:
virtual void InitGame(const FString & MapName, const FString & Options, FString & ErrorMessage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment