39 lines
579 B
C#
39 lines
579 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public class Ability : MonoBehaviour
|
|
{
|
|
[Header("Cooldown")]
|
|
public float currentCooldown;
|
|
public float cooldown;
|
|
[Header("Stats")]
|
|
public int power;
|
|
|
|
[Header("Targetting")]
|
|
public Transform origin;
|
|
public Vector3 direction;
|
|
|
|
public bool TryAbility()
|
|
{
|
|
if (currentCooldown <= 0)
|
|
{
|
|
currentCooldown = cooldown;
|
|
AbilityEffects();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
protected virtual void AbilityEffects()
|
|
{
|
|
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (currentCooldown >= 0)
|
|
{
|
|
currentCooldown -= Time.deltaTime;
|
|
}
|
|
}
|
|
}
|