{"id":28482779,"url":"https://github.com/shadowshardtools/editorgui-plus","last_synced_at":"2025-06-27T19:31:39.330Z","repository":{"id":244270008,"uuid":"809348891","full_name":"ShadowShardTools/EditorGUI-Plus","owner":"ShadowShardTools","description":"Simple unity editor wrapper","archived":true,"fork":false,"pushed_at":"2024-07-25T11:42:38.000Z","size":706,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T21:02:24.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShadowShardTools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-02T12:49:04.000Z","updated_at":"2025-05-06T15:54:39.000Z","dependencies_parsed_at":"2024-07-25T12:44:38.153Z","dependency_job_id":"2871d36a-189a-4daf-8486-6fe1aaa1d291","html_url":"https://github.com/ShadowShardTools/EditorGUI-Plus","commit_stats":null,"previous_names":["keronight/shadowshardeditor","shadowshardtools/shadowshardeditor","shadowshardtools/editorgui-plus"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ShadowShardTools/EditorGUI-Plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadowShardTools%2FEditorGUI-Plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadowShardTools%2FEditorGUI-Plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadowShardTools%2FEditorGUI-Plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadowShardTools%2FEditorGUI-Plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShadowShardTools","download_url":"https://codeload.github.com/ShadowShardTools/EditorGUI-Plus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadowShardTools%2FEditorGUI-Plus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262319008,"owners_count":23292993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T21:02:06.211Z","updated_at":"2025-06-27T19:31:39.323Z","avatar_url":"https://github.com/ShadowShardTools.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![EditorGUIPlus Header Image](Documentation/Images/EditorGUIPlusMainHeader.png)\n\n![GitHub](https://img.shields.io/github/v/release/ShadowShardTools/EditorGUI-Plus)\n![GitHub](https://img.shields.io/github/license/ShadowShardTools/EditorGUI-Plus?style=plastic\u0026label=License\u0026link=https%3A%2F%2Fgithub.com%2FShadowShardTools%2FEditorGUI-Plus%2Fblob%2Fmain%2FLICENSE)\n![GitHub](https://img.shields.io/github/last-commit/ShadowShardTools/EditorGUI-Plus)\n\n# EditorGUI+: simple editor wrapper\n\n## EditorGUI+ Features\n\n* Group Editing - Easily manage and organize GUI elements in groups.\n* Sliders - Create float and integer sliders with custom ranges.\n* Toggles - Add boolean toggles and shader global keyword toggles.\n* Vectors - Draw vector fields for Vector2, Vector2Int, Vector3, Vector3Int, and Vector4 with custom ranges.\n* Textures - Draw texture fields.\n* Popups - Create dropdown menus for enum values and boolean choices.\n* Objects - Manage object fields.\n* Text - Handle text fields.\n* Curves - Draw and edit animation curves.\n\n## MaterialEditorGUI+ Features\n\n* Group Editing - Easily manage and organize GUI elements in groups.\n* Sliders - Create float and integer sliders with custom ranges.\n* Toggles - Add boolean toggles and shader global keyword toggles.\n* Vectors - Draw vector fields for Vector2, Vector2Int, Vector3, Vector3Int, and Vector4 with custom ranges.\n* Textures - Draw texture fields.\n* Popups - Create dropdown menus for enum values and boolean choices.\n* Objects - Manage scriptable object fields.\n\n## Using EditorGUI+\n### Initializing EditorGUI+\nTo use EditorGUI+ in your custom editor scripts, you need to create an instance of the EditorGUIPlus class:\n\n```csharp\nusing EditorGUIPlus;\n\npublic class CustomEditorScript : Editor\n{\n    private EditorGUIPlus _editorGUIPlus;\n\n    private void OnEnable()\n    {\n        _editorGUIPlus = new EditorGUIPlus();\n    }\n\n    public override void OnInspectorGUI()\n    {\n        // Use _editorGUIPlus to draw your custom GUI elements\n    }\n}\n```\n### Group Editor\nGroup editors help you organize your GUI elements in a structured manner.\nYou can use two way of drawing groups: **Scopes** or **Methods with actions**.\n\n#### Scopes method\nUsing statement will put the rest of method into the group defined by the scope.\n```csharp\nprivate void DrawVerticalScope()\n{\n    using var scope = _shadowShardEditor.VerticalScope();\n    GUILayout.Label(\"This is a vertical scope\");\n    GUILayout.Label(\"All of this content is vertical\");\n}\n```\n\n#### Methods With actions\nYou may invoke method and pass your content throug a lambda.\n\n```csharp\nVector2 scrollPosition = Vector2.zero;\n\n_editorGUIPlus.ScrollView(() =\u003e\n{\n    _editorGUIPlus.DrawGroup(() =\u003e\n    {\n        // Draw your GUI elements here\n    });\n}, ref scrollPosition);\n```\n\nAnother way is to create a named method and pass a reference.\n\n```csharp\nVector2 scrollPosition = Vector2.zero;\n\n_editorGUIPlus.ScrollView(YourMethodName, ref scrollPosition);\n```\n\n### Sliders\nDraw sliders for float and integer properties with custom ranges.\n\n```csharp\nSerializedProperty floatProperty = serializedObject.FindProperty(\"floatField\");\nSerializedProperty intProperty = serializedObject.FindProperty(\"intField\");\n\n_editorGUIPlus.DrawSlider(new GUIContent(\"Float Slider\"), floatProperty, new FloatRange(0f, 1f));\n_editorGUIPlus.DrawIntSlider(new GUIContent(\"Int Slider\"), intProperty, new IntRange(0, 10));\n```\n\n### Toggles\nAdd boolean toggles to your editor interface.\n\n```csharp\nSerializedProperty toggleProperty = serializedObject.FindProperty(\"toggleField\");\n\n_editorGUIPlus.DrawToggle(new GUIContent(\"Toggle\"), toggleProperty);\n```\n\n### Vectors\nDraw vector fields for Vector2, Vector3, and Vector4 properties.\n\n```csharp\nSerializedProperty vector3Property = serializedObject.FindProperty(\"vector3Field\");\n\n_editorGUIPlus.DrawVector3(new GUIContent(\"Vector3 Field\"), vector3Property, new Vector3Range(Vector3.zero, Vector3.one));\n```\n\n### Textures\nHandle texture fields in your custom editor.\n\n```csharp\nSerializedProperty textureProperty = serializedObject.FindProperty(\"textureField\");\n\n_editorGUIPlus.DrawTexture(new GUIContent(\"Texture Field\"), textureProperty);\n```\n\n### Popups\nCreate dropdown menus for enum values and boolean choices.\n\n```csharp\nSerializedProperty enumProperty = serializedObject.FindProperty(\"enumField\");\n\n_editorGUIPlus.DrawEnumPopup\u003cYourEnumType\u003e(new GUIContent(\"Enum Popup\"), enumProperty);\n```\n\n### Objects\nManage object fields in your custom editor.\n\n```csharp\nSerializedProperty objectProperty = serializedObject.FindProperty(\"objectField\");\n\n_editorGUIPlus.DrawObjectField(new GUIContent(\"Object Field\"), objectProperty, typeof(Object));\n```\n\n### Text\nHandle text fields in your custom editor.\n\n```csharp\nSerializedProperty textProperty = serializedObject.FindProperty(\"textField\");\n\n_editorGUIPlus.DrawTextField(new GUIContent(\"Text Field\"), textProperty);\n```\n\n### Curves\nDraw and edit animation curves in your custom editor.\n\n```csharp\nSerializedProperty curveProperty = serializedObject.FindProperty(\"curveField\");\n\n_editorGUIPlus.DrawCurveField(new GUIContent(\"Curve Field\"), curveProperty);\n```\n\n## Using MaterialEditorGUI+\n### Initializing MaterialEditorGUI+\nTo use MaterialEditorGUI+ in your own material editor scripts, you need to create an instance of the MaterialEditorGUIPlus class or use BaseShaderGUI from EditorGUI+.\nTo do this in your own material editor scripts, initialize it in the base class:\n\n```csharp\npublic class BaseShaderGUI : UnityEditor.ShaderGUI\n{\n    private readonly MaterialEditorGUIPlus _materialEditorGUIPlus = new();\n    .....\n    public override void OnGUI(UnityEditor.MaterialEditor materialEditorIn, MaterialProperty[] properties)\n    {\n        if (materialEditorIn == null)\n            throw new ArgumentNullException(nameof(materialEditorIn));\n            \n        _materialEditor = materialEditorIn;\n        _materialEditorGUIPlus.InitializeMaterialEditor(_materialEditor);\n        Material material = _materialEditor != null ? _materialEditor.target as Material : null;\n            \n        if (material == null)\n            return;\n    }\n}\n```\n\n### MaterialEditorGUI+ BaseShaderGUI\n\n```csharp\nusing EditorGUIPlus.MaterialEditor.ShaderGUI;\n\npublic class ExampleMaterialGUI : BaseShaderGUI\n{\n    public override void OnOpenGUI(Material material)\n    {\n        Sections = new List\u003cMaterialSection\u003e(SetSections(material));\n    }\n\n    public override IEnumerable\u003cMaterialSection\u003e SetSections(Material material)\n    {\n        return new List\u003cMaterialSection\u003e\n        {\n            new Example1Section(),\n            new Example2Section(material)\n            new Example3Section(material)\n        };\n    }\n}\n```\n\n### MaterialSection in MaterialEditorGUI+\n\n```csharp\npublic class Example2Section : MaterialSection\n{\n    private Material _material;\n    protected Property TestProperty = new(\"_TestProfileAsset\");\n    private readonly GUIContent _label = new(\"Test\");\n\n    public Example2Section(Material material) : base(new GUIContent(\"Test Label\"))\n    {\n        _material = material;\n    }\n\n    public override void FindProperties(MaterialProperty[] properties)\n    {\n        TestProperty.Find(properties);\n    }\n\n    public override void DrawProperties(MaterialEditorGUIPlus editor)\n    {\n        ...Draw TestProperty\n    }\n    public override void SetKeywords(Material material)\n    {\n        ...Keywords logic\n    }\n}\n```\n\n### Sliders\nDraw sliders for float and integer properties with custom ranges.\n\n```csharp\nMaterialProperty floatProperty = FindProperty(\"_FloatField\", properties);\nMaterialProperty intProperty = FindProperty(\"_IntField\", properties);\n\n_materialEditorGUIPlus.DrawSlider(new GUIContent(\"Float Slider\"), floatProperty, new FloatRange(0f, 1f));\n_materialEditorGUIPlus.DrawIntSlider(new GUIContent(\"Int Slider\"), intProperty, new IntRange(0, 10));\n```\n\n### Toggles\nAdd boolean toggles to your editor interface.\n\n```csharp\nMaterialProperty toggleProperty = FindProperty(\"_ToggleField\", properties);\n\n_materialEditorGUIPlus.DrawToggle(new GUIContent(\"Toggle\"), toggleProperty);\n```\n\n### Vectors\nDraw vector fields for Vector2, Vector3, and Vector4 properties.\n\n```csharp\nMaterialProperty vector3Property = FindProperty(\"_Vector3Field\", properties);\n\n_materialEditorGUIPlus.DrawVector3(new GUIContent(\"Vector3 Field\"), vector3Property, new Vector3Range(Vector3.zero, Vector3.one));\n```\n\n### Textures\nHandle texture fields in your custom editor.\n\n```csharp\nMaterialProperty textureProperty = FindProperty(\"_TextureField\", properties);\n\n_materialEditorGUIPlus.DrawSingleLineTexture(new GUIContent(\"Texture Field\"), textureProperty);\n```\n\n### Popups\nCreate dropdown menus for selecting from predefined options.\n\n```csharp\nMaterialProperty popupProperty = FindProperty(\"_PopupField\", properties);\nstring[] options = new string[] { \"Option1\", \"Option2\", \"Option3\" };\n\n_materialEditorGUIPlus.DrawPopup(new GUIContent(\"Popup Field\"), popupProperty, options);\n```\n\n### Objects\nManage scriptable object fields in your custom editor.\n\n```csharp\nMaterialProperty ExampleProfileAsset = FindProperty(\"_ExampleProfileAsset\", properties);\nMaterialProperty ExampleProfileHash = FindProperty(\"_ExampleProfileHash\", properties);\n\n_materialEditorGUIPlus.DrawMaterialAssetObject(_material, ExampleProfileAsset.MaterialProperty, ExampleProfileHash.MaterialProperty, DrawExampleProfile, 1);\nreturn;\n\nMaterialAssetObject DrawExampleProfile()\n{\n    string guid = ExampleProfileAsset.MaterialProperty.vectorValue.ToGuid();\n    ExampleProfile assetObject = editor.GetMaterialAssetObjectFromGuid\u003cExampleProfile\u003e(guid);\n            \n    return EditorGUILayout.ObjectField(_label, assetObject, \n        typeof(ExampleProfile), allowSceneObjects: false) as ExampleProfile;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowshardtools%2Feditorgui-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadowshardtools%2Feditorgui-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowshardtools%2Feditorgui-plus/lists"}