Test
This commit is contained in:
@ -3,18 +3,3 @@
|
||||
|
||||
#include "SplineNode.h"
|
||||
|
||||
// Sets default values
|
||||
ASplineNode::ASplineNode()
|
||||
{
|
||||
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||
PrimaryActorTick.bCanEverTick = false;
|
||||
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void ASplineNode::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -6,37 +6,13 @@
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "SplineNode.generated.h"
|
||||
|
||||
class USplineComponent;
|
||||
|
||||
const uint8 bClassic = 0b00;
|
||||
const uint8 bInverted = 0b01;
|
||||
const uint8 bDualSens = 0b10;
|
||||
|
||||
class SplineHolder
|
||||
USTRUCT()
|
||||
struct FSplineNodeOld
|
||||
{
|
||||
SplineHolder()
|
||||
{
|
||||
Spline = nullptr;
|
||||
Direction = bDualSens;
|
||||
}
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
USplineComponent* Spline;
|
||||
uint8 Direction : 3;
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class TUTOBEGGINER_API ASplineNode : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
ASplineNode();
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
TArray<SplineHolder> Splines;
|
||||
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = HUD)
|
||||
// TArray<AActor*> Splines;
|
||||
|
||||
FString Name;
|
||||
};
|
||||
|
||||
27
Source/TutoBegginer/Game/TrackManager.cpp
Normal file
27
Source/TutoBegginer/Game/TrackManager.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "TrackManager.h"
|
||||
|
||||
// Sets default values
|
||||
ATrackManager::ATrackManager()
|
||||
{
|
||||
// Set this actor 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
|
||||
void ATrackManager::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void ATrackManager::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
}
|
||||
|
||||
56
Source/TutoBegginer/Game/TrackManager.h
Normal file
56
Source/TutoBegginer/Game/TrackManager.h
Normal file
@ -0,0 +1,56 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "Components/SplineComponent.h"
|
||||
#include "TrackManager.generated.h"
|
||||
|
||||
const uint8 bClassic = 0b00;
|
||||
const uint8 bInverted = 0b01;
|
||||
const uint8 bDualSens = 0b10;
|
||||
|
||||
USTRUCT(BlueprintType, Blueprintable)
|
||||
struct FSplineHolder
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = HUD)
|
||||
AActor* Spline = nullptr;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = HUD)
|
||||
uint8 Direction = 2;
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType, Blueprintable)
|
||||
struct FSplineNode
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = HUD)
|
||||
TArray<FSplineHolder> SplineHolder;
|
||||
};
|
||||
|
||||
|
||||
UCLASS()
|
||||
class TUTOBEGGINER_API ATrackManager : public AActor
|
||||
{
|
||||
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
ATrackManager();
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = HUD)
|
||||
TArray<FSplineNode> Nodes;
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user