private void Awake() { if (instance != null) { Logger.log?.Warn($"Instance of {this.GetType().Name} already exists, destroying."); GameObject.DestroyImmediate(this); return; } GameObject.DontDestroyOnLoad(this); instance = this; string path = Path.Combine(UnityGame.UserDataPath, $"{Plugin.Name}.ini"); string backupPath = backupPath = Path.Combine(UnityGame.UserDataPath, Plugin.Name, "OldProfiles"); if (File.Exists(path)) { RootConfig rootConfig = new RootConfig(path); if (!Directory.Exists(backupPath)) { Directory.CreateDirectory(backupPath); } File.Copy(path, Path.Combine(backupPath, $"{Plugin.Name}.ini"), true); File.Delete(path); } ConfigConverter.ProfileConverter(); SceneManager.activeSceneChanged += this.OnActiveSceneChanged; CameraUtilities.CreateMainDirectory(); CameraUtilities.CreateExampleScript(); ConfigConverter.DefaultConfigConverter(); }