2020-08-16 15:15:36 +00:00
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
using UnityEngine;
|
2020-08-13 17:25:12 +00:00
|
|
|
|
|
|
|
|
|
namespace QSB.GeyserSync
|
|
|
|
|
{
|
|
|
|
|
public class GeyserManager : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public static GeyserManager Instance { get; private set; }
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
Instance = this;
|
2020-08-16 20:39:21 +00:00
|
|
|
|
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
2020-08-13 17:25:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-16 20:39:21 +00:00
|
|
|
|
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
2020-08-13 17:25:12 +00:00
|
|
|
|
{
|
2020-08-13 18:43:47 +00:00
|
|
|
|
var geyserControllers = Resources.FindObjectsOfTypeAll<GeyserController>();
|
|
|
|
|
for (var id = 0; id < geyserControllers.Length; id++)
|
2020-08-13 17:25:12 +00:00
|
|
|
|
{
|
2020-08-16 15:15:36 +00:00
|
|
|
|
var qsbGeyser = new QSBGeyser();
|
|
|
|
|
qsbGeyser.Init(geyserControllers[id], id);
|
|
|
|
|
WorldRegistry.AddObject(qsbGeyser);
|
2020-08-13 17:25:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-08-13 18:43:47 +00:00
|
|
|
|
|
2020-08-13 17:47:54 +00:00
|
|
|
|
public void EmptyUpdate()
|
|
|
|
|
{
|
|
|
|
|
QSB.Helper.HarmonyHelper.EmptyMethod<GeyserController>("Update");
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-13 17:25:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|