Mister_Nebula a4a79544e3 cleanup
2020-12-23 23:11:03 +00:00

33 lines
727 B
C#

using QSB.Patches;
using QSB.WorldSync;
using UnityEngine;
namespace QSB.GeyserSync
{
public class GeyserManager : MonoBehaviour
{
public void Awake()
{
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
QSBPatchManager.OnPatchType += OnPatchType;
}
public void OnDestroy()
{
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
QSBPatchManager.OnPatchType -= OnPatchType;
}
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
=> QSBWorldSync.Init<QSBGeyser, GeyserController>();
public void OnPatchType(QSBPatchTypes type)
{
if (type != QSBPatchTypes.OnNonServerClientConnect)
{
return;
}
QSBCore.Helper.HarmonyHelper.EmptyMethod<GeyserController>("Update");
}
}
}