2021-06-11 13:34:27 +00:00
|
|
|
|
using QSB.Utility;
|
|
|
|
|
using UnityEngine;
|
2020-11-11 08:31:20 +00:00
|
|
|
|
|
2021-06-11 13:34:27 +00:00
|
|
|
|
namespace QSB.Inputs
|
2020-11-11 08:31:20 +00:00
|
|
|
|
{
|
2020-12-02 21:29:53 +00:00
|
|
|
|
public class QSBInputManager : MonoBehaviour
|
|
|
|
|
{
|
2021-03-06 13:00:28 +00:00
|
|
|
|
// TODO : finish instruments - disabled for 0.7.0 release
|
|
|
|
|
/*
|
2021-02-09 12:22:49 +00:00
|
|
|
|
public static event Action ChertTaunt;
|
|
|
|
|
public static event Action EskerTaunt;
|
|
|
|
|
public static event Action RiebeckTaunt;
|
|
|
|
|
public static event Action GabbroTaunt;
|
|
|
|
|
public static event Action FeldsparTaunt;
|
|
|
|
|
public static event Action ExitTaunt;
|
2020-11-11 08:31:20 +00:00
|
|
|
|
|
2020-12-02 21:29:53 +00:00
|
|
|
|
public void Update()
|
|
|
|
|
{
|
|
|
|
|
if (Input.GetKey(KeyCode.T))
|
|
|
|
|
{
|
|
|
|
|
// Listed order is from sun to dark bramble
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Alpha1))
|
|
|
|
|
{
|
|
|
|
|
ChertTaunt?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.Alpha2))
|
|
|
|
|
{
|
|
|
|
|
EskerTaunt?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.Alpha5))
|
|
|
|
|
{
|
|
|
|
|
RiebeckTaunt?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.Alpha4))
|
|
|
|
|
{
|
|
|
|
|
GabbroTaunt?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.Alpha3))
|
|
|
|
|
{
|
|
|
|
|
FeldsparTaunt?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-11 08:56:03 +00:00
|
|
|
|
|
2020-12-02 21:29:53 +00:00
|
|
|
|
if (OWInput.GetValue(InputLibrary.moveXZ, InputMode.None) != Vector2.zero
|
|
|
|
|
|| OWInput.GetValue(InputLibrary.jump, InputMode.None) != 0f)
|
|
|
|
|
{
|
|
|
|
|
ExitTaunt?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-06 10:13:13 +00:00
|
|
|
|
*/
|
2021-06-11 13:34:27 +00:00
|
|
|
|
|
|
|
|
|
public static QSBInputManager Instance { get; private set; }
|
|
|
|
|
|
2021-06-19 10:26:05 +00:00
|
|
|
|
public void Start()
|
2021-06-11 13:34:27 +00:00
|
|
|
|
=> Instance = this;
|
|
|
|
|
|
|
|
|
|
public bool InputsEnabled { get; private set; } = true;
|
|
|
|
|
|
|
|
|
|
public void SetInputsEnabled(bool enabled)
|
|
|
|
|
{
|
|
|
|
|
DebugLog.DebugWrite($"INPUTS ENABLED? : {enabled}");
|
|
|
|
|
InputsEnabled = enabled;
|
|
|
|
|
}
|
2020-12-02 21:29:53 +00:00
|
|
|
|
}
|
2020-12-03 08:28:05 +00:00
|
|
|
|
}
|