i am looking respectfully
This commit is contained in:
parent
3160bff7a3
commit
084aada510
29 changed files with 2891 additions and 482 deletions
32
Assets/Scripts/PlayerAbility.cs
Normal file
32
Assets/Scripts/PlayerAbility.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerAbility : MonoBehaviour
|
||||
{
|
||||
[Header("Identification")]
|
||||
public string abilityName;
|
||||
[Header("Cooldown")]
|
||||
public float cooldown;
|
||||
private float currentCooldown;
|
||||
|
||||
public void TryAbility()
|
||||
{
|
||||
if (currentCooldown <= 0)
|
||||
{
|
||||
currentCooldown = cooldown;
|
||||
AbilityEffects();
|
||||
}
|
||||
}
|
||||
|
||||
protected void AbilityEffects()
|
||||
{
|
||||
|
||||
}
|
||||
protected virtual void Update()
|
||||
{
|
||||
if (currentCooldown > 0)
|
||||
{
|
||||
currentCooldown -= Time.deltaTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue