mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 21:59:16 +00:00
33 lines
945 B
C#
33 lines
945 B
C#
using QSB.WorldSync;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.GeyserSync
|
|
{
|
|
public class GeyserManager : MonoBehaviour
|
|
{
|
|
public static GeyserManager Instance { get; private set; }
|
|
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
|
}
|
|
|
|
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
|
{
|
|
var geyserControllers = Resources.FindObjectsOfTypeAll<GeyserController>();
|
|
for (var id = 0; id < geyserControllers.Length; id++)
|
|
{
|
|
var qsbGeyser = WorldRegistry.GetObject<QSBGeyser>(id) ?? new QSBGeyser();
|
|
qsbGeyser.Init(geyserControllers[id], id);
|
|
WorldRegistry.AddObject(qsbGeyser);
|
|
}
|
|
}
|
|
|
|
public void EmptyUpdate()
|
|
{
|
|
QSB.Helper.HarmonyHelper.EmptyMethod<GeyserController>("Update");
|
|
}
|
|
|
|
}
|
|
} |