- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- [CreateAssetMenu(menuName = "Abilities/Dash")]
- public class Dash : Abilities
- {
- [SerializeField]
- private float moveForce;
- [SerializeField]
- private float immortalityTimer;
-
- public override void Effects(PlayerController player)
- {
- Vector3 direction;
- Debug.Log(player.manaScript.mana > manaCost);
- if (player.manaScript.mana > manaCost)
- {
-
- if (player.zInput != 0 || player.xInput != 0)
- {
- player.manaScript.mana -= manaCost;
- direction = (player.transform.forward * player.zInput) + (player.transform.right * player.xInput);
- player.rb.velocity = direction * moveForce;
- player.healthScript.immortality = true;
- player.dashing = true;
- }
- }
- }
- }