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

#pragma once

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

class AmainCharacter;

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

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

	// 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 hit();


private:
	AmainCharacter *player;

	USkeletalMeshComponent	*humanMesh;
	UcustomAnimInstance		*animationInstance;

	float hitForce;
	float characterRotation;
	
	float actionTimer;
	float actionTimeChange;
	int action;

	bool attacking;
	float attackTimer;

	int health;
	bool dead;
	
	UActorComponent *GetComponentByName(const char *pName);
	
	
};
