diff --git a/.gitignore b/.gitignore index 0669d7ecb..cd1357110 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,5 @@ spine-ue4/SpineUE4.VC.opendb spine-ue4/SpineUE4.VC.db spine-ue4/SpineUE4.sln spine-ue4/SpineUE4.VC.db +spine-ue4/.vs/ +spine-ue4/SpineUE4.VC.VC.opendb diff --git a/spine-ue4/Content/GettingStarted/06-cpp.umap b/spine-ue4/Content/GettingStarted/06-cpp.umap new file mode 100644 index 000000000..fddce8eb5 Binary files /dev/null and b/spine-ue4/Content/GettingStarted/06-cpp.umap differ diff --git a/spine-ue4/Source/SpineUE4/SpineUE4.Build.cs b/spine-ue4/Source/SpineUE4/SpineUE4.Build.cs index 4a282057d..63503caff 100644 --- a/spine-ue4/Source/SpineUE4/SpineUE4.Build.cs +++ b/spine-ue4/Source/SpineUE4/SpineUE4.Build.cs @@ -6,7 +6,8 @@ public class SpineUE4 : ModuleRules { public SpineUE4(ReadOnlyTargetRules Target) : base(Target) { - PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "SpinePlugin" }); + PublicIncludePaths.AddRange(new string[] { "SpinePlugin/Public", "SpinePlugin/Classes" }); PrivateDependencyModuleNames.AddRange(new string[] { }); diff --git a/spine-ue4/Source/SpineUE4/SpineboyCppPawn.cpp b/spine-ue4/Source/SpineUE4/SpineboyCppPawn.cpp new file mode 100644 index 000000000..21a03a504 --- /dev/null +++ b/spine-ue4/Source/SpineUE4/SpineboyCppPawn.cpp @@ -0,0 +1,37 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "SpineUE4.h" +#include "SpineSkeletonAnimationComponent.h" +#include "SpineboyCppPawn.h" + + +// Sets default values +ASpineboyCppPawn::ASpineboyCppPawn() +{ + // 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 ASpineboyCppPawn::BeginPlay() +{ + Super::BeginPlay(); + USpineSkeletonAnimationComponent* animation = FindComponentByClass(); + animation->SetAnimation(0, FString("walk"), true); +} + +// Called every frame +void ASpineboyCppPawn::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + +} + +// Called to bind functionality to input +void ASpineboyCppPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) +{ + Super::SetupPlayerInputComponent(PlayerInputComponent); + +} + diff --git a/spine-ue4/Source/SpineUE4/SpineboyCppPawn.h b/spine-ue4/Source/SpineUE4/SpineboyCppPawn.h new file mode 100644 index 000000000..d79fe6798 --- /dev/null +++ b/spine-ue4/Source/SpineUE4/SpineboyCppPawn.h @@ -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 "SpineboyCppPawn.generated.h" + +UCLASS() +class SPINEUE4_API ASpineboyCppPawn : public APawn +{ + GENERATED_BODY() + +public: + // Sets default values for this pawn's properties + ASpineboyCppPawn(); + +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; + + + +};