void UARActionStateCooldown::Tick(float DeltaTime)
{
	if (IsOnCooldown)
	{
		CurrentCooldownTime += DeltaTime;
		float ActionCooldownTime = GetOuterUARActionStateComponent()->ActionCooldownTime;
		if (CurrentCooldownTime >= ActionCooldownTime)
		{
			CooldownEnded();
			GetOuterUARActionStateComponent()->GotoState(GetOuterUARActionStateComponent()->ActiveState);
		}
	}
}
void UARActionStateFiring::Tick(float DeltaTime)
{
	if (FireStarted)
	{
		CurrentIntervalTime += DeltaTime;
		if (CurrentIntervalTime >= GetOuterUARActionStateComponent()->IntervalTime)
		{
			GetOuterUARActionStateComponent()->ActionInterval();
			//IsFirstFire = false;
			CurrentIntervalTime = 0;
		}
	}
}
void UARActionStateCooldown::CooldownEnded()
{
	GetOuterUARActionStateComponent()->CooldownEnded();
}
void UARActionStateCooldown::BeginState(UARActionState* PrevState)
{
	GetOuterUARActionStateComponent()->CooldownBegin();
	IsOnCooldown = true;
}
void UARActionStateFiring::EndActionSequence()
{
	GetOuterUARActionStateComponent()->GotoState(GetOuterUARActionStateComponent()->RefireState);
}
void UARActionStateFiring::EndState()
{
	FireStarted = false;
	GetOuterUARActionStateComponent()->CastEnd();
	CurrentIntervalTime = 0;
}
void UARActionStateFiring::BeginState(UARActionState* PrevState)
{
	GetOuterUARActionStateComponent()->CastBegin();
	//GetOuterUARActionStateComponent()->IsCasting = false;
	FireStarted = true;
}