private void Start() { #region general loading gameplayManager = new GameplayManager(); ApplicationQuitRequest += OnApplicationRequestQuit; #endregion #region scene initialization EnvironmentController.environmentSoundType = EnvironmentController.SoundType.closed; AudioHandler.Init(); #endregion #region load and handle control scheme if ((int)SaveManager.Load(SaveManager.DataType.dint, "LGO").data == 0) // game has never been launched, 1 = launched { Debug.Log("Game is launching for the first time. Assigning default settings..."); SaveManager.AddData("LGO", 1); InputHandler.AssignDefaults(); InputHandler.Save(); } InputHandler.Status status = InputHandler.Load(); if (status == InputHandler.Status.ok) { Debug.Log("Found control scheme."); } else if (status == InputHandler.Status.notfound) { Debug.LogWarning("Control scheme not found, falling back to defaults..."); InputHandler.AssignDefaults(); } else if (status == InputHandler.Status.noparse) { Debug.LogWarning("Control scheme could not be parsed correctly, falling back to defaults..."); InputHandler.AssignDefaults(); } #endregion #region Discord Rich Presence and Multiplayer controller MasterDRPController tdrp; if (useDRP) { if (TryGetComponent <MasterDRPController>(out tdrp)) { masterDRPController = tdrp; } else { masterDRPController = gameObject.AddComponent <MasterDRPController>(); } masterDRPController.Initialize(new Discord.Activity { State = initialState, Details = initialDetail }); } #endregion }
private void SetAduio(Scene unused, LoadSceneMode _unused) { AudioHandler.Init(); AudioHandler.Refresh(); }