void OnGUI() { try { GUILayout.BeginHorizontal(); { GUILayout.BeginVertical(GUILayout.Width(120)); { ///=============== /// SelectionBox ///=============== GUILayout.Space(30); EditorGUIUtility.LookLikeControls(180f); GUI.DrawTexture(new Rect(0, 0, Screen.width * 0.24f, Screen.height), DeployGateWindowUtility.backgroundTexture); GUI.Label(new Rect(0, 0, Screen.width * 0.24f, Screen.height), "", "PreferencesSectionBox"); sectionStyle.normal.textColor = EditorGUIUtility.isProSkin ? new Color(0.7f, 0.7f, 0.7f, 1) : Color.black; selection = (DeployGateWindowUtility.DeployGateSelection)GUILayout.SelectionGrid((int)selection, secsions, 1, sectionStyle); sectionStyle.onNormal.background = DeployGateWindowUtility.onNomalTexture; } GUILayout.EndVertical(); GUILayout.BeginVertical(); { ///============== /// Selections ///============== switch (selection) { case DeployGateWindowUtility.DeployGateSelection.BuildUpload: DeployGateBuildWindow.OnGUI_BuildWindow(preference); break; case DeployGateWindowUtility.DeployGateSelection.Members: DeployGateMembersWindow.OnGUI_DeployGateMembersWindow(); break; case DeployGateWindowUtility.DeployGateSelection.Setings: DeployGatePreferenceWindow.OnGUI_PreferenceWindow(preference); break; case DeployGateWindowUtility.DeployGateSelection.Help: default: DeployGateHelpWindow.OnGUI_DeployGateHelpWindow(); break; } } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); } catch (System.InvalidOperationException) { } }
void OnEnable() { preference = Asset.Load <DeployGatePreference>(); DeployGateBuildWindow.Reset(); EditorUtility.UnloadUnusedAssets(); }