{"id":27455066,"url":"https://github.com/cyi0310/animator-parameter","last_synced_at":"2026-04-29T06:36:01.207Z","repository":{"id":287691382,"uuid":"965378340","full_name":"Cyi0310/Animator-Parameter","owner":"Cyi0310","description":"在Unity的專案環境下，使用指定的Attribute，能取得Animator內部的Parameter功能","archived":false,"fork":false,"pushed_at":"2025-06-08T14:53:27.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T15:35:31.510Z","etag":null,"topics":["animator-parameter","csharp","unity"],"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/Cyi0310.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-13T03:02:34.000Z","updated_at":"2025-06-08T14:53:32.000Z","dependencies_parsed_at":"2025-04-15T15:16:31.899Z","dependency_job_id":"26efaf67-793d-4184-b2ab-cfc4ff0e997d","html_url":"https://github.com/Cyi0310/Animator-Parameter","commit_stats":null,"previous_names":["cyi0310/animator-parameter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cyi0310/Animator-Parameter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyi0310%2FAnimator-Parameter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyi0310%2FAnimator-Parameter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyi0310%2FAnimator-Parameter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyi0310%2FAnimator-Parameter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cyi0310","download_url":"https://codeload.github.com/Cyi0310/Animator-Parameter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyi0310%2FAnimator-Parameter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263250596,"owners_count":23437288,"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":["animator-parameter","csharp","unity"],"created_at":"2025-04-15T15:16:29.220Z","updated_at":"2026-04-29T06:36:01.202Z","avatar_url":"https://github.com/Cyi0310.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Animator Parameter \n#### [README_ZH](https://github.com/Cyi0310/Animator-Parameter/blob/main/README_ZH.md)\n\n`AnimatorParameter` is a custom Unity attribute that automatically lists available parameters from the specified Animator directly in the Inspector. This helps prevent human errors caused by manually typing strings and reduces the chances of compilation or runtime issues due to incorrect parameter names.\n\n## Demo\n\u003e ![](https://github.com/user-attachments/assets/cff8a344-2218-4361-ad31-a73f6cea1345)\n\n## Feature\n- Automatically lists Animator parameter names\n- Selectable in the Inspector without manual input\n- Prevents typos and invalid parameter references\n- Supports both `Animator Component in the scene` and `AnimatorController Asset file in the project`.\n\n## How to use\n- Create an `Animator` or `AnimatorController` field\n- Create a string field to store the parameter name\n- Apply [AnimatorParameter(nameof(anim))] to the string field\n\nThis allows you to select the corresponding parameter from a dropdown in the Inspector.\n\n### Scenario 1: Using the Animator Component in the scene\n```csharp\npublic class UseParameterSimple : MonoBehaviour\n{\n    [SerializeField]\n    private Animator anim;\n    \n    // Apply the AnimatorParameter attribute to the string field\n    [SerializeField, AnimatorParameter(nameof(anim))]\n    private string animParameter;\n}\n```\n\n### Scenario 2: Using the AnimatorController Asset file in the project\n``` C#\npublic class UseParameterSimple2 : MonoBehaviour\n{\n    [SerializeField]\n    private AnimatorController controllerAsset;\n\n    // Apply the AnimatorParameter attribute to the string field\n    [SerializeField, AnimatorParameter(nameof(controllerAsset))]\n    private string controllerAssetParam;\n}\n```\n\n### Scenario 3: Supports cross-hierarchy inheritance to retrieve the field\n``` C#\npublic class BaseEntity : MonoBehaviour\n{\n    [SerializeField]\n    protected Animator anim;\n}\n\npublic class ChildEntity : BaseEntity\n{\n    // The child class can directly reference the parent class's anim field\n    [SerializeField, AnimatorParameter(nameof(anim))]\n    private string jumpParam;\n}\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyi0310%2Fanimator-parameter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyi0310%2Fanimator-parameter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyi0310%2Fanimator-parameter/lists"}