movement, automated enemies, automated players, basic abilities
This commit is contained in:
parent
23576e137e
commit
f4344c4700
31 changed files with 4343 additions and 70 deletions
39
Assets/Scripts/Ability.cs
Normal file
39
Assets/Scripts/Ability.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue