示例#1
0
        public override void Initialize(Dictionary <string, Dictionary <string, GameObject> > preloaded)
        {
            instance = this;

            instance.Log("Initializing");

            Bench.GenerateBenchData();
            BenchMaker.GetPrefabs(preloaded);
            UnityEngine.SceneManagement.SceneManager.activeSceneChanged += BenchMaker.TryToDeploy;

            UIObj = new GameObject();
            UIObj.AddComponent <GUIController>();
            GameObject.DontDestroyOnLoad(UIObj);

            ModHooks.Instance.SetPlayerBoolHook += BenchWatcher;
            UnityEngine.SceneManagement.SceneManager.activeSceneChanged += ClearSettings;
            ModHooks.Instance.ApplicationQuitHook += SaveGlobalSettings;

            ModHooks.Instance.GetPlayerStringHook += RescueSave;

            ModHooks.Instance.GetPlayerStringHook += RespawnAtDeployedBench;
            ModHooks.Instance.GetPlayerIntHook    += RespawnAtDeployedBench2;
            ModHooks.Instance.SetPlayerStringHook += RemoveRespawnFromDeployedBench;

            GUIController.Instance.BuildMenus();

            if (Benchwarp.instance.Settings.benchDeployed && GameManager.instance.sceneName == Benchwarp.instance.Settings.benchScene)
            {
                BenchMaker.MakeBench();
            }
        }
        public override void Initialize(Dictionary <string, Dictionary <string, GameObject> > preloaded)
        {
            if (instance != null)
            {
                return;
            }

            instance = this;

            instance.Log("Initializing");

            Bench.GenerateBenchData();
            BenchMaker.GetPrefabs(preloaded);
            UnityEngine.SceneManagement.SceneManager.activeSceneChanged += BenchMaker.TryToDeploy;

            GameObject UIObj = new GameObject();

            UIObj.AddComponent <GUIController>();
            GameObject.DontDestroyOnLoad(UIObj);

            ModHooks.Instance.SetPlayerBoolHook += BenchWatcher;
            UnityEngine.SceneManagement.SceneManager.activeSceneChanged += ClearSettings;
            ModHooks.Instance.ApplicationQuitHook += SaveGlobalSettings;

            GUIController.Instance.BuildMenus();
        }