Commit 4e5c9eb6 authored by Ridel Morgan's avatar Ridel Morgan
Browse files

update

parent 6b7c07a1
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -4,6 +4,7 @@
#include "Engine/World.h"
#include "TankBarrel.h"
#include "Projectile.h"
#include "TankMovementComponent.h"
......
// Fill out your copyright notice in the Description page of Project Settings.
#include "TankMovementComponent.h"
#include "TankTrack.h"
void UTankMovementComponent::IntendMoveForward(float Throw)
{
if (!LeftTrack || !RightTrack) { return; }
LeftTrack->SetThrottle(Throw);
RightTrack->SetThrottle(Throw);
}
void UTankMovementComponent::IntendMoveRight(float Throw)
{
if (!LeftTrack || !RightTrack) { return; }
LeftTrack->SetThrottle(Throw);
RightTrack->SetThrottle(-Throw);
}
void UTankMovementComponent::Initialize(UTankTrack* LeftTrack, UTankTrack * RightTrack)
{
if (!LeftTrack || !RightTrack) { return; }
this->LeftTrack = LeftTrack;
this->RightTrack = RightTrack;
}
......@@ -10,6 +10,7 @@
class UTankBarrel;
class UTankTurret;
class AProjectile;
class UTankMovementComponent;
UCLASS()
......
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/NavMovementComponent.h"
#include "TankMovementComponent.generated.h"
class UTankTrack;
/**
*
*/
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class BATTLETANKS_API UTankMovementComponent : public UNavMovementComponent
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable)
void IntendMoveForward(float Throw);
UFUNCTION(BlueprintCallable)
void IntendMoveRight(float Throw);
UFUNCTION(BlueprintCallable, Category=Setup)
void Initialize(UTankTrack* LeftTrack, UTankTrack* RightTrack);
private:
UTankTrack* LeftTrack = nullptr;
UTankTrack* RightTrack = nullptr;
};
Supports Markdown
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