public void Awake() { if (_instance != null) { Destroy(this); return; } _instance = this; }
public void OnDestroy() { config.SetValue("mainWindowRect", mainWindowRect); config.SetValue("defaultSkinName", defaultSkinName); config.save(); if (_instance == this) { _instance = null; } GameEvents.onGUIApplicationLauncherReady.Remove(OnAppLauncherReady); GameEvents.onGameSceneSwitchRequested.Remove(OnSwitchRequested); }