39 lines
617 B
C#
39 lines
617 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public class Ability : MonoBehaviour
|
|
{
|
|
public Entity thisEntity;
|
|
protected float currentCooldown;
|
|
public float cooldown;
|
|
public float power;
|
|
public Vector3 targetLocation;
|
|
|
|
protected virtual void Update()
|
|
{
|
|
if (currentCooldown > 0f)
|
|
{
|
|
currentCooldown -= Time.deltaTime;
|
|
}
|
|
|
|
if (Input.GetMouseButtonDown(0))
|
|
{
|
|
TryAbility(); //testing, please remove
|
|
}
|
|
}
|
|
|
|
public bool TryAbility()
|
|
{
|
|
if (currentCooldown <= 0f)
|
|
{
|
|
AbilityEffects();
|
|
currentCooldown = cooldown;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
protected virtual void AbilityEffects()
|
|
{
|
|
|
|
}
|
|
}
|