Exemple #1
0
        public void OnApplicationStart()
        {
            if (_init)
            {
                return;
            }
            _init    = true;
            Instance = this;

            _harmony = new Harmony("com.brian91292.beatsaber.cameraplus");
            try
            {
                _harmony.PatchAll(Assembly.GetExecutingAssembly());
            }
            catch (Exception ex)
            {
                Logger.Log($"Failed to apply harmony patches! {ex}", LogLevel.Error);
            }

            SceneManager.activeSceneChanged += this.OnActiveSceneChanged;
            // Add our default cameraplus camera
            CameraUtilities.AddNewCamera(Plugin.MainCamera);
            CameraProfiles.CreateMainDirectory();

            _profileChanger        = new ProfileChanger();
            MultiplayerSessionInit = false;
            Logger.Log($"{Plugin.Name} has started", LogLevel.Notice);

            if (Utils.IsModInstalled("VMCAvatar"))
            {
                ExistsVMCAvatar = true;
            }
        }
Exemple #2
0
 public override bool Init(CameraPlusBehaviour cameraPlus)
 {
     if (Utils.IsModInstalled("Song Loader Plugin"))
     {
         _cameraPlus = cameraPlus;
         Plugin.Instance.ActiveSceneChanged += SceneManager_activeSceneChanged;
         return(true);
     }
     return(false);
 }
 public override bool Init(CameraPlusBehaviour cameraPlus)
 {
     if (Utils.IsModInstalled("BS_Utils"))
     {
         _cameraPlus = cameraPlus;
         Plugin.Instance.ActiveSceneChanged += OnActiveSceneChanged;
         return(true);
     }
     return(false);
 }