Commit 9820594e by wester

added

parent 74d654df
No preview for this file type
...@@ -3,18 +3,18 @@ ...@@ -3,18 +3,18 @@
#include "MasterTestProject.h" #include "MasterTestProject.h"
#include "MyGameInstance.h" #include "MyGameInstance.h"
#include "PointCloudActor.h" #include "PointCloudActor.h"
#include "FileHelper.h"
#include "VRPawnCode.h" #include "VRPawnCode.h"
// Sets default values // Sets default valuesx
AVRPawnCode::AVRPawnCode() AVRPawnCode::AVRPawnCode()
{ {
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it. // 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; PrimaryActorTick.bCanEverTick = true;
} }
// Called when the game starts or when spawned // Called when the game starts or when spawned
...@@ -25,6 +25,27 @@ void AVRPawnCode::BeginPlay() ...@@ -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 // Called every frame
void AVRPawnCode::Tick(float DeltaTime) void AVRPawnCode::Tick(float DeltaTime)
{ {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/Pawn.h" #include "GameFramework/Pawn.h"
#include "UDPSender.h" #include "UDPSender.h"
#include "VRPawnCode.generated.h" #include "VRPawnCode.generated.h"
UCLASS() UCLASS()
...@@ -39,6 +40,10 @@ public: ...@@ -39,6 +40,10 @@ public:
UFUNCTION(BlueprintCallable, Category = "pointCloud") UFUNCTION(BlueprintCallable, Category = "pointCloud")
void setPoincloudPosition(FVector position, float angle); 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