parent
f2ed196c3e
commit
c86a21fa67
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "MyGameState.h"
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameState.h"
|
||||
#include "MyGameState.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class TURNBASEDTUTORIAL_API AMyGameState : public AGameState
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "MyPawn.h"
|
||||
|
||||
|
||||
// Sets default values
|
||||
AMyPawn::AMyPawn()
|
||||
{
|
||||
// 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
|
||||
void AMyPawn::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void AMyPawn::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
}
|
||||
|
||||
// Called to bind functionality to input
|
||||
void AMyPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||
{
|
||||
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Pawn.h"
|
||||
#include "MyPawn.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class TURNBASEDTUTORIAL_API AMyPawn : public APawn
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this pawn's properties
|
||||
AMyPawn();
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
// Called to bind functionality to input
|
||||
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||
|
||||
|
||||
|
||||
};
|
@ -0,0 +1,10 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "MyPlayerStart.h"
|
||||
|
||||
uint8 AMyPlayerStart::GetPlayerIndex() const {
|
||||
return PlayerIndex;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/PlayerStart.h"
|
||||
#include "MyPlayerStart.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class TURNBASEDTUTORIAL_API AMyPlayerStart : public APlayerStart
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
|
||||
uint8 GetPlayerIndex() const;
|
||||
|
||||
protected:
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, Category="Spawn Info")
|
||||
uint8 PlayerIndex=0;
|
||||
};
|
Loading…
Reference in new issue