quantum-space-buddies/QSB/OrbSync/OrbSlotManager.cs
Mister_Nebula d8d1bc8395 stuff idk
2020-08-26 20:50:30 +01:00

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));
}
}
}