Commit 9820594e by wester

added

parent 74d654df
No preview for this file type
......@@ -3,18 +3,18 @@
#include "MasterTestProject.h"
#include "MyGameInstance.h"
#include "PointCloudActor.h"
#include "FileHelper.h"
#include "VRPawnCode.h"
// Sets default values
// Sets default valuesx
AVRPawnCode::AVRPawnCode()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
......@@ -25,6 +25,27 @@ void AVRPawnCode::BeginPlay()
}
bool AVRPawnCode::appendFile(FString fileName, FString SaveText) {
FString path;
path = FPaths::GameDir();
path += "/Logs";
if (!FPlatformFileManager::Get().GetPlatformFile().DirectoryExists(*path))
{
FPlatformFileManager::Get().GetPlatformFile().CreateDirectory(*path);
if (!FPlatformFileManager::Get().GetPlatformFile().DirectoryExists(*path))
{
return false;
}
}
path += "/";
path += fileName;
return FFileHelper::SaveStringToFile(SaveText+"\n", *path, FFileHelper::EEncodingOptions::ForceUTF8, &IFileManager::Get(), EFileWrite::FILEWRITE_Append );
}
// Called every frame
void AVRPawnCode::Tick(float DeltaTime)
{
......
......@@ -5,6 +5,7 @@
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "UDPSender.h"
#include "VRPawnCode.generated.h"
UCLASS()
......@@ -39,6 +40,10 @@ public:
UFUNCTION(BlueprintCallable, Category = "pointCloud")
void setPoincloudPosition(FVector position, float angle);
UFUNCTION(BlueprintCallable, Category = "Output")
bool appendFile(FString fileName, FString SaveText);
};
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