2020-11-07 21:20:30 +00:00
|
|
|
|
using QSB.Animation;
|
|
|
|
|
using QSB.EventsCore;
|
2020-11-01 12:26:09 +00:00
|
|
|
|
using QSB.Instruments.QSBCamera;
|
2020-11-03 21:33:48 +00:00
|
|
|
|
using QSB.Player;
|
2020-10-27 22:59:19 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace QSB.Instruments
|
|
|
|
|
{
|
|
|
|
|
public class InstrumentsManager : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public static InstrumentsManager Instance;
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
Instance = this;
|
|
|
|
|
gameObject.AddComponent<CameraManager>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Keypad9))
|
|
|
|
|
{
|
2020-11-03 21:18:40 +00:00
|
|
|
|
if (!QSBPlayerManager.LocalPlayer.PlayingInstrument)
|
2020-11-01 12:26:09 +00:00
|
|
|
|
{
|
|
|
|
|
CameraManager.Instance.SwitchTo3rdPerson();
|
2020-11-02 22:15:46 +00:00
|
|
|
|
SwitchToInstrument(InstrumentType.RIEBECK);
|
2020-11-07 21:20:30 +00:00
|
|
|
|
QSBPlayerManager.GetSyncObject<AnimationSync>(QSBPlayerManager.LocalPlayerId).SetAnimationType(AnimationType.Chert);
|
2020-11-01 12:26:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
CameraManager.Instance.SwitchTo1stPerson();
|
2020-11-01 15:56:48 +00:00
|
|
|
|
SwitchToInstrument(InstrumentType.NONE);
|
2020-11-01 12:26:09 +00:00
|
|
|
|
}
|
2020-10-27 22:59:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-01 15:56:48 +00:00
|
|
|
|
|
|
|
|
|
public void SwitchToInstrument(InstrumentType type)
|
|
|
|
|
{
|
2020-11-03 21:18:40 +00:00
|
|
|
|
QSBPlayerManager.LocalPlayer.CurrentInstrument = type;
|
2020-11-01 15:56:48 +00:00
|
|
|
|
GlobalMessenger<InstrumentType>.FireEvent(EventNames.QSBPlayInstrument, type);
|
|
|
|
|
}
|
2020-10-27 22:59:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|