{"id":14960752,"url":"https://github.com/rimurudev/unity-percentdrawer","last_synced_at":"2025-10-24T19:30:18.944Z","repository":{"id":209896829,"uuid":"725212178","full_name":"RimuruDev/Unity-PercentDrawer","owner":"RimuruDev","description":"Percentage Property Drawer for Unity | Draw percentages in the editor | How to display the drop chance in unity ","archived":false,"fork":false,"pushed_at":"2024-08-31T20:56:39.000Z","size":34,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-22T11:31:13.222Z","etag":null,"topics":["attribute","attributes","custom","custom-draw","custom-drawer","drop","drop-chance","gamedesign","level-design","percentage","percentage-drawer","random","rimuru-dev","rimurudev","unity-attribute","unity-editor","unity-editor-gui"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RimuruDev.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":"2023-11-29T17:07:22.000Z","updated_at":"2024-08-31T20:56:42.000Z","dependencies_parsed_at":"2023-11-29T18:28:47.960Z","dependency_job_id":"db489f8b-3286-44a2-a60a-aeb943dc2394","html_url":"https://github.com/RimuruDev/Unity-PercentDrawer","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.5,"last_synced_commit":"3e10a51b28cbb90752b8ec4094e31eed159c92e1"},"previous_names":["rimurudev/unity-percentdrawer"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimuruDev%2FUnity-PercentDrawer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimuruDev%2FUnity-PercentDrawer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimuruDev%2FUnity-PercentDrawer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimuruDev%2FUnity-PercentDrawer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RimuruDev","download_url":"https://codeload.github.com/RimuruDev/Unity-PercentDrawer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219867815,"owners_count":16554365,"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":["attribute","attributes","custom","custom-draw","custom-drawer","drop","drop-chance","gamedesign","level-design","percentage","percentage-drawer","random","rimuru-dev","rimurudev","unity-attribute","unity-editor","unity-editor-gui"],"created_at":"2024-09-24T13:22:53.664Z","updated_at":"2025-10-24T19:30:18.656Z","avatar_url":"https://github.com/RimuruDev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ch1\u003e⭐Percentage Property Drawer for Unity⭐\u003c/h1\u003e\u003c/p\u003e\n \u003cp align=\"center\"\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Made With Unity\" src=\"https://img.shields.io/badge/made%20with-Unity-57b9d3.svg?logo=Unity\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n  \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/RimuruDev/Unity-PercentDrawer?logo=github\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Last Commit\" src=\"https://img.shields.io/github/last-commit/RimuruDev/Unity-PercentDrawer?logo=Mapbox\u0026color=orange\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Repo Size\" src=\"https://img.shields.io/github/repo-size/RimuruDev/Unity-PercentDrawer?logo=VirtualBox\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Downloads\" src=\"https://img.shields.io/github/downloads/RimuruDev/Unity-PercentDrawer/total?color=brightgreen\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Last Release\" src=\"https://img.shields.io/github/v/release/RimuruDev/Unity-PercentDrawer?include_prereleases\u0026logo=Dropbox\u0026color=yellow\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/RimuruDev/Unity-PercentDrawer?branch=main\u0026label=Stars\u0026logo=GitHub\u0026logoColor=ffffff\u0026labelColor=282828\u0026color=informational\u0026style=flat\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"GitHub user stars\" src=\"https://img.shields.io/github/stars/RimuruDev?affiliations=OWNER\u0026branch=main\u0026label=User%20Stars\u0026logo=GitHub\u0026logoColor=ffffff\u0026labelColor=282828\u0026color=informational\u0026style=flat\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/github/watchers/RimuruDev/Unity-PercentDrawer?style=flat\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\nThis solution includes a custom attribute `PercentageAttribute` and a property drawer `PercentDrawer` that work together\nto provide a convenient way of displaying float values as percentages in the Unity Editor.\n\n![image](https://github.com/RimuruDev/Unity-PercentDrawer/assets/85500556/274123a4-415b-4b49-825c-ab7a0568262a)\n![image](https://github.com/RimuruDev/Unity-PercentDrawer/assets/85500556/689774b6-279a-4a74-96f4-76a054025398)\n\n### Option 1: Install via Unity Package Manager\n\n1. Open Unity and go to `Window` \u003e `Package Manager`.\n2. Click the `+` button in the top left corner.\n3. Select `Add package from git URL...`.\n4. Enter the following URL:   ``` https://github.com/RimuruDev/Unity-PercentDrawer.git ```\n5. Click `Add` to install the package.\n\n6. If error -\n```\nLibrary/PackageCache/unity-percent-drawer@390d399580/Sources/Editor/PercentDrawer.cs(22,34):\nerror CS0246: The type or namespace name 'PercentageAttribute' could not be found (are you missing a using directive or an assembly reference?)\n```\nGo next -\u003e Option 2: Install from Releases\n\n\n### Option 2: Install from Releases\n\n1. Go to the [Releases](https://github.com/RimuruDev/Unity-PercentDrawer/releases) page in this repository.\n2. Download the latest `.unitypackage` file.\n3. In Unity, go to `Assets` \u003e `Import Package` \u003e `Custom Package...`.\n4. Select the downloaded `.unitypackage` file and import it into your project.\n\n### Option 3: Install from copy-past\n\n1. Create a folder named `Editor` within your project's `Assets` directory if it does not already exist. Unity requires\n   that all editor scripts be located in a folder named `Editor`.\n2. Create a folder named `Attributes` within your `Assets` directory to store custom attributes.\n3. Place the `PercentageAttribute.cs` file inside the `Attributes` folder.\n4. Place the `PercentDrawer.cs` file inside the `Editor` folder.\n\nYour folder structure should look like this:\n\n```text\nAssets/\n│\n├── Editor/\n│ └── PercentDrawer.cs\n│\n└── Attributes/\n└── PercentageAttribute.cs\n```\n\n## Usage\n\nTo use the `PercentageAttribute`, you first need to define it in a script file:\n\n```csharp\n// PercentageAttribute.cs\nusing UnityEngine;\n\npublic class PercentageAttribute : PropertyAttribute {}\n```\n\nThen, apply the [Percentage] attribute to any float field in your MonoBehaviour or ScriptableObject classes:\n\n```csharp\n// SomeScript.cs\nusing UnityEngine;\n\npublic class SomeScript : MonoBehaviour\n{\n    [Percentage]\n    public float dropChance;\n}\n```\n\nWhen you select a GameObject with this script attached in the Unity Editor, you'll see the dropChance field displayed as\na slider with a percentage value next to it.\n\n# Customizing the Drawer\n\nIf you wish to customize the behavior of the `PercentDrawer`, you can edit the `PercentDrawer.cs` file within\nthe `Editor` folder. Comments in the code provide guidance on what each part does and how to adjust the layout.\n\n# Support\n\nFor support, questions, or contributions, please open an issue on the repository's issue tracker.\n\nContributing\nContributions to improve the `PercentageAttribute` and `PercentDrawer` are welcome. Please follow the standard pull\nrequest process to submit improvements.\n\n# License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\nMade by RimuruDev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frimurudev%2Funity-percentdrawer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frimurudev%2Funity-percentdrawer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frimurudev%2Funity-percentdrawer/lists"}