refactor: cleaning movement code
moved skills and potions to skill handler
This commit is contained in:
@@ -31,27 +31,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space) && !playerSkillHandler.IsOnCooldown(PlayerSkillTree.Skills.Dash))
|
||||
{
|
||||
/* Get the input for horizontal and vertical movement */
|
||||
float moveX = Input.GetAxisRaw("Horizontal");
|
||||
float moveZ = Input.GetAxisRaw("Vertical");
|
||||
|
||||
move = new Vector3(moveX, 0, moveZ).normalized;
|
||||
StartCoroutine(playerSkillHandler.DashCoroutine(controller, move));
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.L))
|
||||
{
|
||||
if(PlayerSkills.TryUsePotion(PotionHandler.PotionType.HealthBig))
|
||||
{
|
||||
Debug.Log("Potion used!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Potion not available!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
|
||||
Reference in New Issue
Block a user