mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-18 13:23:05 +00:00
53974485c9
* add stuff * extract patches * extract worldobjects (#241) * add spiral sync * cleanup * cleanup * fix * rename * add computers * remove qnet flagshelper * Update README.md * cleanup
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using QSB.TranslationSync.WorldObjects;
|
|
using QSB.WorldSync;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.TranslationSync
|
|
{
|
|
internal class SpiralManager : MonoBehaviour
|
|
{
|
|
public static SpiralManager Instance { get; private set; }
|
|
|
|
private List<NomaiWallText> _nomaiWallTexts;
|
|
private List<NomaiComputer> _nomaiComputers;
|
|
private List<NomaiVesselComputer> _nomaiVesselComputers;
|
|
|
|
public void Awake()
|
|
{
|
|
Instance = this;
|
|
QSBSceneManager.OnUniverseSceneLoaded += OnSceneLoaded;
|
|
}
|
|
|
|
public void OnDestroy() => QSBSceneManager.OnUniverseSceneLoaded -= OnSceneLoaded;
|
|
|
|
private void OnSceneLoaded(OWScene scene)
|
|
{
|
|
_nomaiWallTexts = QSBWorldSync.Init<QSBWallText, NomaiWallText>();
|
|
_nomaiComputers = QSBWorldSync.Init<QSBComputer, NomaiComputer>();
|
|
_nomaiVesselComputers = QSBWorldSync.Init<QSBVesselComputer, NomaiVesselComputer>();
|
|
}
|
|
|
|
public int GetId(NomaiWallText obj) => _nomaiWallTexts.IndexOf(obj);
|
|
public int GetId(NomaiComputer obj) => _nomaiComputers.IndexOf(obj);
|
|
public int GetId(NomaiVesselComputer obj) => _nomaiVesselComputers.IndexOf(obj);
|
|
}
|
|
}
|