static Style() { brushColor = new Color(0, 0, 0, 0.4f); treeIcon = ToolboxEditorUtility.LoadEditorAsset <Texture>("Editor Tree Icon.png"); bushIcon = ToolboxEditorUtility.LoadEditorAsset <Texture>("Editor Bush Icon.png"); settingsIcon = ToolboxEditorUtility.LoadEditorAsset <Texture>("Editor Settings Icon.png"); smallIconStyle = new GUIStyle() { alignment = TextAnchor.MiddleCenter }; headerToggleStyle = new GUIStyle(EditorStyles.foldout) { fontStyle = FontStyle.Bold }; treeToggleContent = new GUIContent(treeIcon, "Paint trees."); bushToggleContent = new GUIContent(bushIcon, "Paint bushes."); toggleOptions = new GUILayoutOption[] { GUILayout.MaxWidth(40), GUILayout.MaxHeight(40) }; smallIconOptions = new GUILayoutOption[] { GUILayout.MaxWidth(20), GUILayout.MaxHeight(20) }; }
private void OnEnable() { forceSceneProperty = serializedObject.FindProperty("forceScene"); desiredSceneProperty = serializedObject.FindProperty("desiredSceneName"); defaultSceneProperty = serializedObject.FindProperty("defaultScene"); availableScenesProperty = serializedObject.FindProperty("availableScenes"); onInitEndProperty = serializedObject.FindProperty("onInitEnd"); availableScenesList = ToolboxEditorUtility.CreateList(availableScenesProperty, ListStyle.Round); }
private void DrawStandardInputs() { EditorGUILayout.LabelField("Script Name"); scriptName = EditorGUILayout.TextField(scriptName); EditorGUILayout.LabelField("Namespace"); namespaceName = EditorGUILayout.TextField(namespaceName); EditorGUI.BeginChangeCheck(); useNamespaceForSubFolders = EditorGUILayout.ToggleLeft("Use namespace for sub-folders", useNamespaceForSubFolders); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetBool("ScriptGenerators.NamespaceToDirectory", useNamespaceForSubFolders); } ToolboxEditorUtility.DrawLayoutLine(); }
private void DrawConstructionSettings() { EditorGUILayout.BeginVertical(Style.sectionStyle); if (constructionSettingsShown = EditorGUILayout.Foldout(constructionSettingsShown, "Construction Settings", Style.sectionHeaderStyle)) { EditorGUILayout.Space(); constructionsPath = EditorGUILayout.TextField("Prefab Save Path", constructionsPath); constructionName = EditorGUILayout.TextField("Construction Name", constructionName); constructionMesh = EditorGUILayout.ObjectField("Construction Mesh", constructionMesh, typeof(GameObject), true) as GameObject; ToolboxEditorUtility.DrawLayoutAssetPreview(constructionMesh, 90, 90); constructionPivot = EditorGUILayout.Vector2Field("Construction Mesh Pivot", constructionPivot); constructionSize = EditorGUILayout.Vector2IntField("Construction Size", constructionSize); EditorGUILayout.Space(); } EditorGUILayout.EndVertical(); if (selectedSquares.Length != constructionSize.x * constructionSize.y) { Array.Resize(ref selectedSquares, constructionSize.x * constructionSize.y); } }
private void DrawButtonsStrip() { ToolboxEditorUtility.DrawLayoutLine(); if (GUILayout.Button("Save at Default Path")) { DoSaveAtDefaultPath(); } if (GUILayout.Button("Save As")) { DoSaveAs(); } EditorGUILayout.Space(); if (GUILayout.Button("Copy to Clipboard")) { DoCopyToClipboard(); } }
public EditorPaintToolSection(string toolName, Texture tooIcon, SerializedProperty prefabs) : this(toolName, tooIcon, ToolboxEditorUtility.CreateRoundList(prefabs)) { }