private void OnPaintExamples(Rect bounds, Texture2D header) { GUILayout.BeginArea(bounds); string content = "Learn from the <b>Example Scenes</b>"; Rect contentRect = this.OnPaintPage(bounds, "EXAMPLE SCENES", header, 80f); EditorGUI.LabelField(contentRect, content, contentStyle); Rect btnRect = GUILayoutUtility.GetRect(GUIContent.none, GUI.skin.button); btnRect = new Rect(btnRect.x + 15f, btnRect.y, btnRect.width - 30f, btnRect.height); if (GUI.Button(btnRect, "See Example Scenes")) { string scenePath = "Assets/Plugins/GameCreator/Examples/Scenes/Example-Hub.unity"; SceneAsset sceneAsset = AssetDatabase.LoadAssetAtPath <SceneAsset>(scenePath); if (sceneAsset != null) { Selection.activeObject = AssetDatabase.LoadAssetAtPath <SceneAsset>(scenePath); EditorGUIUtility.PingObject(Selection.activeObject); } else { ModuleManagerWindow.OpenModuleManager(); } } GUILayout.EndArea(); }
private void OnPaintModules(Rect bounds, Texture2D header) { GUILayout.BeginArea(bounds); string content = "Check out the <b>Module Manager</b>"; Rect contentRect = this.OnPaintPage(bounds, "MODULE MANAGER", header, 80f); EditorGUI.LabelField(contentRect, content, contentStyle); Rect btnRect = GUILayoutUtility.GetRect(GUIContent.none, GUI.skin.button); btnRect = new Rect(btnRect.x + 15f, btnRect.y, btnRect.width - 30f, btnRect.height); if (GUI.Button(btnRect, "Module Manager")) { ModuleManagerWindow.OpenModuleManager(); } GUILayout.EndArea(); }