mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-11 00:52:19 +00:00
32 lines
1005 B
C#
32 lines
1005 B
C#
using QSB.WorldSync;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.OrbSync
|
|
{
|
|
public class OrbSlotManager : MonoBehaviour
|
|
{
|
|
public static OrbSlotManager Instance { get; private set; }
|
|
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
|
}
|
|
|
|
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
|
{
|
|
var orbSlots = Resources.FindObjectsOfTypeAll<NomaiInterfaceSlot>();
|
|
for (var id = 0; id < orbSlots.Length; id++)
|
|
{
|
|
var qsbOrbSlot = WorldRegistry.GetObject<QSBOrbSlot>(id) ?? new QSBOrbSlot();
|
|
qsbOrbSlot.Init(orbSlots[id], id);
|
|
WorldRegistry.AddObject(qsbOrbSlot);
|
|
}
|
|
}
|
|
|
|
public void StopChecking()
|
|
{
|
|
QSB.Helper.HarmonyHelper.AddPrefix<NomaiInterfaceSlot>("CheckOrbCollision", typeof(OrbSlotPatches), nameof(OrbSlotPatches.CheckOrbCollisionSkip));
|
|
}
|
|
}
|
|
} |