{"id":13661381,"url":"https://github.com/rfadeev/unity-forge-property-drawers","last_synced_at":"2025-03-22T00:31:50.676Z","repository":{"id":139274117,"uuid":"112748421","full_name":"rfadeev/unity-forge-property-drawers","owner":"rfadeev","description":"Custom propery drawers to ease fields value management in Unity editor.","archived":false,"fork":false,"pushed_at":"2020-01-25T05:08:53.000Z","size":527,"stargazers_count":39,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T06:35:48.387Z","etag":null,"topics":["c-sharp","unity","unity-editor","unity-property-attribute","unity-property-drawer"],"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/rfadeev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-12-01T14:22:44.000Z","updated_at":"2023-11-22T11:11:02.000Z","dependencies_parsed_at":"2024-01-17T05:29:30.712Z","dependency_job_id":null,"html_url":"https://github.com/rfadeev/unity-forge-property-drawers","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfadeev%2Funity-forge-property-drawers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfadeev%2Funity-forge-property-drawers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfadeev%2Funity-forge-property-drawers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfadeev%2Funity-forge-property-drawers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rfadeev","download_url":"https://codeload.github.com/rfadeev/unity-forge-property-drawers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890102,"owners_count":20527030,"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":["c-sharp","unity","unity-editor","unity-property-attribute","unity-property-drawer"],"created_at":"2024-08-02T05:01:33.683Z","updated_at":"2025-03-22T00:31:50.205Z","avatar_url":"https://github.com/rfadeev.png","language":"C#","funding_links":[],"categories":["C\\#","Attribute"],"sub_categories":[],"readme":"[![license](https://img.shields.io/github/license/rfadeev/unity-forge-property-drawers.svg)](https://github.com/rfadeev/unity-forge-property-drawers/blob/master/LICENSE.md)\n# Unity Forge Property Drawers\nCustom propery drawers to ease fields value management in Unity editor.\n\n## Attributes list\n* [AnimationName](#animationname)\n* [AnimatorLayerName](#animatorlayername)\n* [AnimatorParameterName](#animatorparametername)\n* [AnimatorStateName](#animatorstatename)\n* [AssetPath](#assetpath)\n* [GameObjectLayer](#gameobjectlayer)\n* [GameObjectTag](#gameobjecttag)\n* [ScenePath](#scenepath)\n* [SortingLayerName](#sortinglayername)\n* [SpriteAtlasSpriteName](#spriteatlasspritename)\n\n## Installation\nProject supports Unity Package Manager. To install project as Git package do following:\n1. Close Unity project and open the `Packages/manifest.json` file.\n2. Update `dependencies` to have `com.rfadeev.unityforge.propertydrawers` package:\n```json\n{\n  \"dependencies\": {\n    \"com.rfadeev.unityforge.propertydrawers\": \"https://github.com/rfadeev/unity-forge-property-drawers.git\"\n  }\n}\n```\n3. Open Unity project.\n\nAlternatively, add this repository as submodule under `Assets` folder or download it and put to `Assets` folder of your Unity project. \n\n## Attributes usage\nImport `UnityForge.PropertyDrawers` namespace to be able to use attribute from the [attributes list](#attributes-list).\n\n## AnimationName\n![screencast](Documentation/animation-name-example.png)\n\n### Attribute usage\nAdd attribute to string field to enable selection of animation name value from dropdown list in Unity editor. Attribute without parameters works on Animation component attached to inspected object.\n```csharp\n[SerializeField, AnimationName]\nprivate string animationName;\n```\n\nSpecify animation component via `animationField` constructor parameter to enable animation name selection from that component.\n```csharp\n[SerializeField]\nprivate Animation exampleAnimation;\n[SerializeField, AnimationName(animationField: \"exampleAnimation\")]\nprivate string animationName;\n```\n\n[Examples of attribute usage](../master/Runtime/Examples/AnimationName)\n\n### Caveats\nUnity manages clips internally specifically so for some reason order of clips returned by [AnimationUtility.GetAnimationClips](https://docs.unity3d.com/ScriptReference/AnimationUtility.GetAnimationClips.html) differs from the one displayed in the editor for Animation comoponent. Due to this expect different order of items in dropdown list for attribute.\n\n## AnimatorLayerName\n![screencast](Documentation/animator-layer-name-example.png)\n\nAdd attribute to string field to enable selection of animator layer name value from dropdown list in Unity editor. Attribute without parameters works on Animator component attached to inspected object.\n```csharp\n[SerializeField, AnimatorLayerName]\nprivate string layerName;\n```\n\nSpecify Animator component via `animatorField` constructor parameter to enable layer name selection from that Animator component.\n```csharp\n[SerializeField]\nprivate Animator exampleAnimator;\n[SerializeField, AnimatorStateName(animatorField: \"exampleAnimator\")]\nprivate string exampleLayerName;\n```\n\n[Examples of attribute usage](../master/Runtime/Examples/AnimatorLayerName)\n\n## AnimatorParameterName\n![screencast](Documentation/animator-parameter-name-example.png)\n\nAdd attribute to string field to enable selection of animator parameter name value from dropdown list in Unity editor. Note that parameter type must be specified for attribute. Attribute without other parameters works on Animator component attached to inspected object.\n```csharp\n[SerializeField, AnimatorParameterName(AnimatorControllerParameterType.Float)]\nprivate string exampleFloatParameterName;\n```\n\nSpecify Animator component via `animatorField` constructor parameter to enable parameter name selection from that Animator component.\n```csharp\n[SerializeField]\nprivate Animator exampleAnimator;\n[SerializeField]\n[AnimatorParameterName(AnimatorControllerParameterType.Float, animatorField: \"exampleAnimator\"))]\nprivate string exampleFloatParameterName;\n```\n\n[Examples of attribute usage](../master/Runtime/Examples/AnimatorParameterName)\n\n## AnimatorStateName\n![screencast](Documentation/animator-state-name-example.gif)\n\n### Attribute usage\nAdd attribute to string field to enable selection of animator state name value from dropdown list in Unity editor. Attribute without parameters works on Animator component attached to inspected object.\n```csharp\n[SerializeField, AnimatorStateName]\nprivate string stateName;\n```\n\nSpecify Animator component via `animatorField` constructor parameter to enable state name selection from that Animator component.\n```csharp\n[SerializeField]\nprivate Animator exampleAnimator;\n[SerializeField, AnimatorStateName(animatorField: \"exampleAnimator\")]\nprivate string exampleStateName;\n```\n\n[Examples of attribute usage](../master/Runtime/Examples/AnimatorStateName)\n\n### Caveats\nSince layer index is [decoupled](https://docs.unity3d.com/ScriptReference/Animator.Play.html) from animator state name in Unity API, state name alone does not determine state and state index value should be managed separately. If only one animation layer is used, it's not the problem and `Play(string stateName)` overload can be used safely for fields using `AnimatorStateName` attribute.\n\n## AssetPath\n![screencast](Documentation/asset-path-example.png)\n\n### Attribute usage\nAdd attribute to string field to enable show object field instead of text input for object path. Object selection updates serialized value of the string field. Attribute declataion requires object type. Attribute supports both full project path (like \"Assets/Sprites/MySpriteA.png\") and resources path type (like \"Sprites/MySpriteB\" for full path value \"Assets/Resources/Sprites/MySpriteB.png\"). Additionnal option allows to preview path value which is serialized.\n```csharp\n[SerializeField, AssetPath(typeof(Sprite), false)]\nprivate string spriteProjectPath01;\n[SerializeField, AssetPath(typeof(Sprite), true)]\nprivate string spriteResourcesPath01;\n[SerializeField, AssetPath(typeof(Sprite), false, true)]\nprivate string spriteProjectPath02;\n[SerializeField, AssetPath(typeof(Sprite), true, true)]\nprivate string spriteResourcesPath02;\n```\n\n[Examples of attribute usage](../master/Runtime/Examples/AssetPath)\n\n## GameObjectLayer\n![screencast](Documentation/game-object-layer-example.png)\n\n### Attribute usage\nAdd attribute to int field to enable selection of game object layer value from dropdown list in Unity editor. Layers are configured in [Tags and Layers Manager](https://docs.unity3d.com/Manual/class-TagManager.html).\n```csharp\n[SerializeField, GameObjectLayer]\nprivate int exampleLayer;\n```\n[Examples of attribute usage](../master/Runtime/Examples/GameObjectLayer)\n\n## GameObjectTag\n![screencast](Documentation/game-object-tag-example.png)\n\n### Attribute usage\nAdd attribute to string field to enable selection of game object tag value from dropdown list in Unity editor. Tags are configured in [Tags and Layers Manager](https://docs.unity3d.com/Manual/class-TagManager.html).\n```csharp\n[SerializeField, GameObjectTag]\nprivate string exampleTag;\n```\n[Examples of attribute usage](../master/Runtime/Examples/GameObjectTag)\n\n## ScenePath\n![screencast](Documentation/scene-path-example.png)\n\n### Attribute usage\nAdd attribute to string field to enable selection of scene path value from dropdown list in Unity editor. Path type can be set via `fullProjectPath` argument: if true, scene path will be full project path like \"Assets/Scenes/MyScene.unity\"; if false, path will be short project path without \"Assets/\" and \".unity\" extension like \"Scenes/MyScene\". Source to populate dropdown can be set via `fromBuildSettings` argument: if true, only scenes from build settings will be shown in dropdown; if false, all scenes from project will be shown in dropdown. Additionally, `onlyEnabled` argument can be used to show only scenes enabled in build settings if `fromBuildSettings` is set to true.\n```csharp\n// Full scene path, only enabled scenes from build settings\n[SerializeField, ScenePath]\nprivate string exampleScenePath01;\n// Short scene path, only enabled scenes from build settings\n[SerializeField, ScenePath(fullProjectPath: false))]\nprivate string exampleScenePath02;\n// Full scene path, all scenes from project\n[SerializeField, ScenePath(fromBuildSettings: false))]\nprivate string exampleScenePath03;\n// Short scene path, all scenes from build settings\n[SerializeField, ScenePath(fullProjectPath: false, onlyEnabled: false))]\nprivate string exampleScenePath04;\n```\n\n[Examples of attribute usage](../master/Runtime/Examples/ScenePath)\n\n## SortingLayerName\n![screencast](Documentation/sorting-layer-name-example.png)\n\n### Attribute usage\nAdd attribute to string field to enable selection of sorting layer name value from dropdown list in Unity editor. Sorting layers are configured in [Tags and Layers Manager](https://docs.unity3d.com/Manual/class-TagManager.html).\n```csharp\n[SerializeField, SortingLayerName]\nprivate string exampleSortingLayerName;\n```\n\n[Examples of attribute usage](../master/Runtime/Examples/SortingLayerName)\n\n## SpriteAtlasSpriteName\n![screencast](Documentation/sprite-atlas-sprite-name-example.png)\n\n### Attribute usage\nAdd attribute to string field and specify sprite atlas field to enable selection of sprite name from that atlas via dropdown list in Unity editor.\n```csharp\n[SerializeField]\nprivate SpriteAtlas atlas;\n[SerializeField, SpriteAtlasSpriteName(spriteAtlasField: \"atlas\")]\nprivate string spriteName;\n```\n\n[Examples of attribute usage](../master/Runtime/Examples/SpriteAtlasSpriteName)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfadeev%2Funity-forge-property-drawers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frfadeev%2Funity-forge-property-drawers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfadeev%2Funity-forge-property-drawers/lists"}