public override void Init(SocketedQuantumObject quantumObject, int id)
 {
     ObjectId       = id;
     AttachedObject = quantumObject;
     base.Init(quantumObject, id);
     if (QSBCore.DebugMode)
     {
         DebugBoxText = DebugBoxManager.CreateBox(AttachedObject.transform, 0, ObjectId.ToString()).GetComponent <Text>();
     }
 }
Beispiel #2
0
 public override void Init(MultiStateQuantumObject attachedObject, int id)
 {
     ObjectId       = id;
     AttachedObject = attachedObject;
     QuantumStates  = AttachedObject.GetValue <QuantumState[]>("_states").ToList().Select(x => QSBWorldSync.GetWorldFromUnity <QSBQuantumState, QuantumState>(x)).ToList();
     if (QSBCore.DebugMode)
     {
         DebugBoxText = DebugBoxManager.CreateBox(AttachedObject.transform, 0, CurrentState.ToString()).GetComponent <Text>();
     }
     base.Init(attachedObject, id);
 }
Beispiel #3
0
    public GameObject CreateDebugBox(LightInfo lightInfo, DetectionBox originInfo)
    {
        GameObject debugBox = Instantiate(DebugBoxPrefab);

        debugBox.transform.SetParent(DebugCanvasTransform);
        debugBox.transform.position = lightInfo.position;

        string          lightType       = (originInfo.id == 1 ? "Area" : (originInfo.id == 2 ? "Point" : "Spot"));
        DebugBoxManager debugBoxManager = debugBox.GetComponent <DebugBoxManager>() as DebugBoxManager;

        debugBoxManager.SetParams(lightType, lightInfo.light.intensity, lightInfo.light.color);

        return(debugBox);
    }
Beispiel #4
0
        public void Start()
        {
            Helper = ModHelper;
            DebugLog.ToConsole($"* Start of QSB version {Helper.Manifest.Version} - authored by {Helper.Manifest.Author}", MessageType.Info);

            NetworkAssetBundle      = Helper.Assets.LoadBundle("assets/network");
            InstrumentAssetBundle   = Helper.Assets.LoadBundle("assets/instruments");
            ConversationAssetBundle = Helper.Assets.LoadBundle("assets/conversation");

            QSBPatchManager.Init();

            gameObject.AddComponent <QSBNetworkManager>();
            gameObject.AddComponent <QNetworkManagerHUD>();
            gameObject.AddComponent <DebugActions>();
            gameObject.AddComponent <ConversationManager>();
            gameObject.AddComponent <QSBInputManager>();
            gameObject.AddComponent <TimeSyncUI>();
            gameObject.AddComponent <RepeatingManager>();
            gameObject.AddComponent <PlayerEntanglementWatcher>();

            // WorldObject managers
            gameObject.AddComponent <QuantumManager>();
            gameObject.AddComponent <SpiralManager>();
            gameObject.AddComponent <ElevatorManager>();
            gameObject.AddComponent <GeyserManager>();
            gameObject.AddComponent <OrbManager>();
            gameObject.AddComponent <QSBSectorManager>();
            gameObject.AddComponent <ItemManager>();
            gameObject.AddComponent <StatueManager>();
            gameObject.AddComponent <PoolManager>();
            gameObject.AddComponent <CampfireManager>();

            DebugBoxManager.Init();

            // Stop players being able to pause
            Helper.HarmonyHelper.EmptyMethod(typeof(OWTime).GetMethod("Pause"));
        }