2021-12-24 00:58:48 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace RhythmHeavenMania
|
|
|
|
{
|
|
|
|
public class PlayerInput
|
|
|
|
{
|
2022-02-22 05:43:31 +00:00
|
|
|
public static bool Pressed(bool includeDPad = false)
|
2021-12-24 00:58:48 +00:00
|
|
|
{
|
2022-02-22 05:43:31 +00:00
|
|
|
bool keyDown = Input.GetKeyDown(KeyCode.Z) || (includeDPad && GetAnyDirectionDown());
|
|
|
|
return keyDown && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
|
2021-12-24 00:58:48 +00:00
|
|
|
}
|
|
|
|
|
2022-02-22 05:43:31 +00:00
|
|
|
public static bool PressedUp(bool includeDPad = false)
|
2021-12-24 23:41:35 +00:00
|
|
|
{
|
2022-02-22 05:43:31 +00:00
|
|
|
bool keyUp = Input.GetKeyUp(KeyCode.Z) || (includeDPad && GetAnyDirectionUp());
|
|
|
|
return keyUp && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
|
2021-12-24 23:41:35 +00:00
|
|
|
}
|
|
|
|
|
2022-02-22 05:43:31 +00:00
|
|
|
public static bool Pressing(bool includeDPad = false)
|
2021-12-24 00:58:48 +00:00
|
|
|
{
|
2022-02-22 05:43:31 +00:00
|
|
|
bool pressing = Input.GetKey(KeyCode.Z) || (includeDPad && GetAnyDirection());
|
|
|
|
return pressing && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
|
2021-12-24 00:58:48 +00:00
|
|
|
}
|
2022-01-20 01:48:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
public static bool AltPressed()
|
|
|
|
{
|
2022-01-23 03:40:53 +00:00
|
|
|
return Input.GetKeyDown(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
|
2022-01-20 01:48:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static bool AltPressedUp()
|
|
|
|
{
|
2022-01-23 03:40:53 +00:00
|
|
|
return Input.GetKeyUp(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
|
2022-01-20 01:48:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static bool AltPressing()
|
|
|
|
{
|
2022-01-23 03:40:53 +00:00
|
|
|
return Input.GetKey(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
|
2022-01-20 01:48:52 +00:00
|
|
|
}
|
2022-02-22 05:43:31 +00:00
|
|
|
|
|
|
|
public static bool GetAnyDirectionDown()
|
|
|
|
{
|
|
|
|
return Input.GetKeyDown(KeyCode.UpArrow)
|
|
|
|
|| Input.GetKeyDown(KeyCode.DownArrow)
|
|
|
|
|| Input.GetKeyDown(KeyCode.LeftArrow)
|
|
|
|
|| Input.GetKeyDown(KeyCode.RightArrow);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static bool GetAnyDirectionUp()
|
|
|
|
{
|
|
|
|
return Input.GetKeyUp(KeyCode.UpArrow)
|
|
|
|
|| Input.GetKeyUp(KeyCode.DownArrow)
|
|
|
|
|| Input.GetKeyUp(KeyCode.LeftArrow)
|
|
|
|
|| Input.GetKeyUp(KeyCode.RightArrow);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static bool GetAnyDirection()
|
|
|
|
{
|
|
|
|
return Input.GetKey(KeyCode.UpArrow)
|
|
|
|
|| Input.GetKey(KeyCode.DownArrow)
|
|
|
|
|| Input.GetKey(KeyCode.LeftArrow)
|
|
|
|
|| Input.GetKey(KeyCode.RightArrow);
|
|
|
|
|
|
|
|
}
|
2021-12-24 00:58:48 +00:00
|
|
|
}
|
|
|
|
}
|