Mister_Nebula 53974485c9
Spiral sync (#242)
* add stuff

* extract patches

* extract worldobjects (#241)

* add spiral sync

* cleanup

* cleanup

* fix

* rename

* add computers

* remove qnet flagshelper

* Update README.md

* cleanup
2020-12-31 12:10:55 +00:00

34 lines
762 B
C#

using QSB.GeyserSync.WorldObjects;
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");
}
}
}