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:
2025-08-28 17:58:02 +02:00
parent dc083bfc93
commit 8eac9d6bde
3 changed files with 61 additions and 9 deletions

View File

@@ -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");