Skip to content

Commit

Permalink
[ue4] Added simple C++ example
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Jul 4, 2017
1 parent 807c4d2 commit 15011e8
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added spine-ue4/Content/GettingStarted/06-cpp.umap
Binary file not shown.
3 changes: 2 additions & 1 deletion spine-ue4/Source/SpineUE4/SpineUE4.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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[] { });

Expand Down
37 changes: 37 additions & 0 deletions spine-ue4/Source/SpineUE4/SpineboyCppPawn.cpp
Original file line number Diff line number Diff line change
@@ -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<USpineSkeletonAnimationComponent>();
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);

}

31 changes: 31 additions & 0 deletions spine-ue4/Source/SpineUE4/SpineboyCppPawn.h
Original file line number Diff line number Diff line change
@@ -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;



};

0 comments on commit 15011e8

Please sign in to comment.