// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "GameFramework/Character.h"
#include "mainCharacter.generated.h"

class UcustomAnimInstance;

UCLASS()
class LD35_API AmainCharacter : public ACharacter
{
	GENERATED_BODY()

public:
	// Sets default values for this character's properties
	AmainCharacter();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
	
	void MoveForward(float Value);
	void MoveRight(float Value);
	void LookSide(float Value);
	void LookUp(float Value);
	
	void Transform(float Value);
	void Attack(float Value);

	bool isTransformed();


private:
	UActorComponent *GetComponentByName(const char *pName);

	FVector movementDirection;
	FRotator lookRotation;
	float characterRotation;
	float transformValue;
	FVector birdSize;
	
	UCameraComponent		*camera;
	USkeletalMeshComponent	*humanMesh;
	UStaticMeshComponent	*birdMesh;
	UcustomAnimInstance		*animationInstance;
	
	bool transformed;
	bool attacking;
	bool attackButtonDown;
	float attackTimer;
	
};
