private void OnApplicationQuit() { Debug.Log("OnApplicationQuit"); isRunningGame = false; if (layout_open_in_playmode.Count > 0 && U3DExtends.Configure.ReloadLayoutOnExitGame) { System.Action <UnityEditor.PlayModeStateChange> p = null; p = new System.Action <UnityEditor.PlayModeStateChange>((UnityEditor.PlayModeStateChange c) => { foreach (var item in layout_open_in_playmode) { // Debug.Log("item.Key : "+item.Key); Transform layout = UIEditorHelper.LoadLayoutByPath(item.Key); if (layout != null) { layout.localPosition = item.Value; } } layout_open_in_playmode.Clear(); UnityEditor.EditorApplication.playModeStateChanged -= p; }); UnityEditor.EditorApplication.playModeStateChanged += p; } }