add exit taunt input

This commit is contained in:
Mister_Nebula 2020-11-11 08:56:03 +00:00
parent 486756740b
commit 6fe621b791
2 changed files with 22 additions and 8 deletions

View File

@ -23,6 +23,7 @@ namespace QSB.Instruments
QSBInputManager.GabbroTaunt += () => StartInstrument(AnimationType.Gabbro);
QSBInputManager.RiebeckTaunt += () => StartInstrument(AnimationType.Riebeck);
QSBInputManager.SolanumTaunt += () => StartInstrument(AnimationType.Solanum);
QSBInputManager.ExitTaunt += () => ReturnToPlayer();
}
private void OnDestroy()
@ -33,6 +34,7 @@ namespace QSB.Instruments
QSBInputManager.GabbroTaunt -= () => StartInstrument(AnimationType.Gabbro);
QSBInputManager.RiebeckTaunt -= () => StartInstrument(AnimationType.Riebeck);
QSBInputManager.SolanumTaunt -= () => StartInstrument(AnimationType.Solanum);
QSBInputManager.ExitTaunt -= () => ReturnToPlayer();
}
public void StartInstrument(AnimationType type)

View File

@ -8,25 +8,31 @@ using UnityEngine;
namespace QSB
{
public delegate void TauntEvent();
public delegate void InputEvent();
public class QSBInputManager : MonoBehaviour
{
public static QSBInputManager Instance;
public static event TauntEvent ChertTaunt;
public static event TauntEvent EskerTaunt;
public static event TauntEvent FeldsparTaunt;
public static event TauntEvent GabbroTaunt;
public static event TauntEvent RiebeckTaunt;
public static event TauntEvent SolanumTaunt;
public static event InputEvent ChertTaunt;
public static event InputEvent EskerTaunt;
public static event InputEvent FeldsparTaunt;
public static event InputEvent GabbroTaunt;
public static event InputEvent RiebeckTaunt;
public static event InputEvent SolanumTaunt;
public static event InputEvent ExitTaunt;
public void Awake()
{
Instance = this;
if (Input.GetKeyDown(KeyCode.T))
}
public void Update()
{
if (Input.GetKey(KeyCode.T))
{
if (Input.GetKeyDown(KeyCode.Alpha1))
{
DebugLog.DebugWrite("chert");
ChertTaunt?.Invoke();
}
if (Input.GetKeyDown(KeyCode.Alpha2))
@ -50,6 +56,12 @@ namespace QSB
SolanumTaunt?.Invoke();
}
}
if (OWInput.GetValue(InputLibrary.moveXZ, InputMode.None) != Vector2.zero
|| OWInput.GetValue(InputLibrary.jump, InputMode.None) != 0f)
{
ExitTaunt?.Invoke();
}
}
}
}