Cooldowns, SkillHandler modification
Implementation of cooldowns for skills and spells, made dependency on monoBehaviour for SkillHandler(future implementation of update, fixed update possible)
This commit is contained in:
@@ -21,7 +21,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
PlayerSkills = PlayerSkillTree.Instance;
|
||||
playerSkillHandler = new PlayerSkillHandler(dashSpeed, dashDuration);
|
||||
playerSkillHandler = GetComponent<PlayerSkillHandler>();
|
||||
}
|
||||
|
||||
void Start()
|
||||
@@ -31,7 +31,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
if (Input.GetKeyDown(KeyCode.Space) && !playerSkillHandler.IsOnCooldown(PlayerSkillTree.Skills.Dash))
|
||||
{
|
||||
/* Get the input for horizontal and vertical movement */
|
||||
float moveX = Input.GetAxisRaw("Horizontal");
|
||||
|
||||
Reference in New Issue
Block a user