예제 #1
0
        private static void SwitchToCamlist(List <string> cams)
        {
            if (cams?.Count == 0)
            {
                cams = null;
            }

            /*
             * Intentionally checking != false, this way if cams is null OR
             * it contains it, the cam will be activated, only if its
             * a non-empty scene we want to hide cams that are not in it
             */
            foreach (var cam in CamManager.cams)
            {
                if (cam.Value == null)
                {
                    continue;
                }

                var camShouldBeActive = cams?.Contains(cam.Key) != false || UI.SettingsView.cam == cam.Value;

                cam.Value.gameObject.SetActive(camShouldBeActive);
            }

            GL.Clear(true, true, Color.black);

            GlobalFPSCap.Postfix();
        }
예제 #2
0
        public void OnApplicationStart()
        {
            harmony = new Harmony("Kinsi55.BeatSaber.Cam2");
            harmony.PatchAll(Assembly.GetExecutingAssembly());

            MovementScriptManager.LoadMovementScripts();
            GlobalFPSCap.Init();

            SceneManager.activeSceneChanged += SceneUtil.OnActiveSceneChanged;

            // Marinate the Reflection stuff off-thread so the loading of cameras later is less blocking
            Task.Run(() => {
                ModmapExtensions.Reflect();
                ScoresaberUtil.Reflect();
                CustomNotesUtil.Reflect();
            });
        }