{"id":18926871,"url":"https://github.com/shaun-fong/uitoolkit-fieldbinding","last_synced_at":"2025-04-15T13:33:33.832Z","repository":{"id":108114358,"uuid":"598155497","full_name":"Shaun-Fong/UIToolkit-FieldBinding","owner":"Shaun-Fong","description":"Code generation for unity VTA(VisualTreeAsset) fields , quick data binding. UIToolkit自动绑定工具，一键生成依赖代码，自动绑定。","archived":false,"fork":false,"pushed_at":"2023-09-27T03:23:17.000Z","size":120,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T22:08:21.307Z","etag":null,"topics":["databinding","generated-code","uielement","uitoolkit","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/Shaun-Fong.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-02-06T14:19:37.000Z","updated_at":"2024-12-03T09:14:04.000Z","dependencies_parsed_at":"2023-07-03T15:16:48.945Z","dependency_job_id":null,"html_url":"https://github.com/Shaun-Fong/UIToolkit-FieldBinding","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/Shaun-Fong%2FUIToolkit-FieldBinding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shaun-Fong%2FUIToolkit-FieldBinding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shaun-Fong%2FUIToolkit-FieldBinding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shaun-Fong%2FUIToolkit-FieldBinding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shaun-Fong","download_url":"https://codeload.github.com/Shaun-Fong/UIToolkit-FieldBinding/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249080522,"owners_count":21209537,"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":["databinding","generated-code","uielement","uitoolkit","unity"],"created_at":"2024-11-08T11:17:23.341Z","updated_at":"2025-04-15T13:33:33.415Z","avatar_url":"https://github.com/Shaun-Fong.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/16713354/217272667-fe624616-0b66-4eee-b6d4-ed63b2225f09.png\"\u003e\n\u003c/p\u003e\n\n**New [binding system](https://forum.unity.com/threads/introducing-the-runtime-bindings-api-in-unity-2023-2.1454221/) is out.(2023.2+)**\n\n## Binding\n- This little tool can save you a lot of time using the `Q\u003cT\u003e` interface. (I'm so tired of written `Q\u003cT\u003e` over and over again...)\n- 这个小工具可以帮你在使用Unity的UIToolkit获取指定组件的时候节省非常多的时间。\n- One Click to generate binding code.\n- 一键生成需要的绑定脚本。\n- Search the field what you need.\n- 使用检索来查找字段\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/16713354/217278859-d88412aa-da4c-4262-842e-1b194a76bd0c.gif\"\u003e\n\u003c/p\u003e\n\n## Usage 使用\n- Assign Source Asset (给上UIDocument的Source Asset)\n- Click `Menu/Generate` (点击`Menu/Generate`)\n- Select the location where the script was generated in popup files save panel, in example file is `BindTest`, it will generate `BindTest_BindFields`.(在弹出的保存窗口中选中脚本保存的位置，示例中直接选中`BindTest.cs`脚本即可，将会自动生成名为`BindTest_BindFields`脚本文件)\n- Next time you can click `Generate` for quick regen.(当你做了UI修改之后，下次可以直接点击`Generate`按钮快速进行重新生成绑定脚本)\n- [Example Script](./Assets/Examples/Scripts/BindTest.cs)\n- [Example Binding Script](./Assets/Examples/Scripts/BindTest_BindFields.cs)\n\n![image](https://user-images.githubusercontent.com/16713354/217477617-7ae576ad-1d46-447a-9a77-a6db862d0e72.png)\n\n1. Namespace (命名空间)\n2. Change the location where the script was generated. (更改脚本生成位置)\n3. Generate Button. (点击即可生成)\n4. The location where the script was generated. (脚本生成的位置)\n5. Script Content Generate preview. (预览)\n\n### Generate/Save/Save As/Select in Menu 菜单按钮选项\n\n![image](https://user-images.githubusercontent.com/16713354/217478834-f7189c95-ab32-4350-a3d7-a2417346628f.png)\n\nClick `Menu` and you can see many options\n- `Generate` is for fast generate. `Save File Panel` will popup when you first time generate. (快速生成的按钮)\n- `Save` is for saving selected fileds data to disk. (保存选中字段的数据到硬盘，下次加载会自动选中)\n- `Save As` is for regen the data.Popup `Save File Panel` every time. (另存为，重新定位脚本)\n- `Select` provides a variety of ways to quickly select fields, the most common and default is `ValidName`. (`Select` 提供多种快速选中字段的方式，最常用和默认用的是`ValidName`)\n\n### Filter 过滤\n\n![image](https://user-images.githubusercontent.com/16713354/217481441-d85c2580-f2c2-4164-aba8-350cc09aa92b.png)\n\nYou can open the `Filter` option by clicking the button in the upper right corner.\n\n你可以通过点击右上角的按钮打开`过滤`选项\n\n### Valid Fileds? 有效字段\nThe `element name` in `UIBuilder` rules are as follows below.Like you normally declare a variable.\n在`UIBuilder`中的元素名称的规则跟你正常声明一个变量的规则就行。\n- The name can contain letters, digits, and the underscore character (_).\n- The first character of the name must be a letter. The underscore is also a legal first character, but its use is not recommended at the beginning of a name. An underscore is often used with special commands, and it's sometimes hard to read.\n- Case matters (that is, upper- and lowercase letters). C# is case-sensitive; thus, the names count and Count refer to two different variables.\n- C# keywords can't be used as variable names. Recall that a keyword is a word that is part of the C# language. (A complete list of the C# keywords can be found in Appendix B, \"C# Keywords.\")\n![image](https://user-images.githubusercontent.com/16713354/217474726-8eb55b0c-7dfa-43c7-9e15-5edc6d9f8b87.png)\n\n(The field is invalid because the beginning contains invalid characters `-`)\n(字段无效是因为开头有一个`-`符号)\n\n\n\n## Install\n\n### Via Unity Package Manager 通过PackageManager直接使用Git链接\nAdd Package From Git URL\n`https://github.com/Shaun-Fong/UIToolkit-FieldBinding.git?path=/Packages/com.shaunfong.uitoolkit-binding`\n\n### Or 或者\n\n### Via OpenUPM 通过OpenUPM（推荐）\n- open `Edit/Project Settings/Package Manager`(打开PackageManager配置，`Edit/Project Settings/Package Manager`)\n- add a new Scoped Registry (or edit the existing OpenUPM entry) (点击右上角齿轮添加一个`Scoped Registry`，添加如下)\n\nName `package.openupm.com`\n\nURL `https://package.openupm.com`\n\n- click `Save` (or `Apply`) (点击`保存`)\n- open `Window/Package Manager` (打开PackageManager)\n- click `+` (点击加号)\n- select `Add package by name...` or `Add package from git URL...` (点击`Add package by name...` 或 `Add package from git URL...`)\n- paste `com.shaunfong.uitoolkit-fieldbinding` into name (粘贴`com.shaunfong.uitoolkit-fieldbinding`)\n- paste `1.0.0` into version (粘贴`1.0.0`到版本)\n- click `Add` (点击`Add`添加)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaun-fong%2Fuitoolkit-fieldbinding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaun-fong%2Fuitoolkit-fieldbinding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaun-fong%2Fuitoolkit-fieldbinding/lists"}