{"id":16055013,"url":"https://github.com/codewriter-packages/view-binding","last_synced_at":"2025-03-17T16:32:04.554Z","repository":{"id":57685443,"uuid":"372251180","full_name":"codewriter-packages/View-Binding","owner":"codewriter-packages","description":"View binding library for Unity. Built over UniMob","archived":false,"fork":false,"pushed_at":"2023-12-02T11:18:29.000Z","size":170,"stargazers_count":28,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-16T13:01:54.898Z","etag":null,"topics":["c-sharp","data-binding","game","game-development","game-engine","gamedev","mvvm","ui","unity","unity3d","view-binding"],"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/codewriter-packages.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}},"created_at":"2021-05-30T15:33:19.000Z","updated_at":"2024-12-15T03:41:25.000Z","dependencies_parsed_at":"2024-10-27T15:31:18.280Z","dependency_job_id":"ea764a16-2323-408d-8c4d-0176ff4be9ec","html_url":"https://github.com/codewriter-packages/View-Binding","commit_stats":{"total_commits":119,"total_committers":2,"mean_commits":59.5,"dds":0.008403361344537785,"last_synced_commit":"0a699c414ea0d004b806f0733b348ff3b04aaa1f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewriter-packages%2FView-Binding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewriter-packages%2FView-Binding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewriter-packages%2FView-Binding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewriter-packages%2FView-Binding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewriter-packages","download_url":"https://codeload.github.com/codewriter-packages/View-Binding/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244068934,"owners_count":20392921,"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","data-binding","game","game-development","game-engine","gamedev","mvvm","ui","unity","unity3d","view-binding"],"created_at":"2024-10-09T02:05:15.928Z","updated_at":"2025-03-17T16:32:04.148Z","avatar_url":"https://github.com/codewriter-packages.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# View Binding [![Github license](https://img.shields.io/github/license/codewriter-packages/View-Binding.svg?style=flat-square)](#) [![Unity 2020.1](https://img.shields.io/badge/Unity-2020.1+-2296F3.svg?style=flat-square)](#) ![GitHub package.json version](https://img.shields.io/github/package-json/v/codewriter-packages/View-Binding?style=flat-square) [![openupm](https://img.shields.io/npm/v/com.codewriter.view-binding?label=openupm\u0026registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.codewriter.view-binding/)\n_View binding library for unity_\n\n#### NOTE: To use View Binding library you need to install [Tri Inspector](https://github.com/codewriter-packages/Tri-Inspector) - Free and open-source library that improves unity inspector.\n\n## How to use?\n\n#### 1. Setup ViewContext\nViewContext contains the data necessary to display current part of the interface.\n\n![View Context Preview](https://user-images.githubusercontent.com/26966368/160893683-222809f4-8753-41ca-967e-78864f4c75e6.png)\n\n#### 2. Add applicators and Binders\n\nApplicators reactively update components (Text, Slider, etc) when data changes in ViewContext. \nBinders subscribes to events and pass them to ViewContext.\n\n![Text Applicator Preview](https://user-images.githubusercontent.com/26966368/160635846-c5fcbf6f-633b-4eda-b14e-ac4783a07cf2.png)\n\n#### 3. Set values from code\n\n![Code Preview](https://user-images.githubusercontent.com/26966368/160636024-ee024ecf-98a3-4571-b29b-8638fb80e7d1.png)\n\n```csharp\nusing UniMob;\nusing UnityEngine;\nusing CodeWriter.ViewBinding;\n\npublic class ViewBindingSample : MonoBehaviour\n{\n    public ViewVariableBool soundEnabled;\n    public ViewVariableBool musicEnabled;\n    public ViewVariableFloat volume;\n\n    public ViewEventVoid onClose;\n\n    private void Start()\n    {\n        soundEnabled.SetValue(true);\n        soundEnabled.SetValue(false);\n        volume.SetValue(0.5f);\n\n        onClose.AddListener(() =\u003e Debug.Log(\"Close clicked\"));\n    }\n}\n```\n\n## Documentation\n\n#### Builtin variable types:\n- Boolean (ViewVariableBool)\n- Integer (ViewVariableInt)\n- Float (ViewVariableFloat)\n- String (ViewVariableString)\n\n#### Builtin event types:\n- Void (ViewEventVoid)\n- Boolean (ViewEventBool)\n- Integer (ViewEventInt)\n- Float (ViewEventFloat)\n- String (ViewEventString)\n\n#### Builtin applicators:\n- UnityEvent ([Bool](./Runtime/Applicators/UnityEvent/UnityEventBoolApplicator.cs), [Float](./Runtime/Applicators/UnityEvent/UnityEventFloatApplicator.cs), [Integer](./Runtime/Applicators/UnityEvent/UnityEventIntApplicator.cs), [String](./Runtime/Applicators/UnityEvent/UnityEventStringApplicator.cs))\n- [GameObject - Activity](./Runtime/Applicators/GameObjectActivityApplicator.cs)\n- [UI CanvasGroup - Alpha](./Runtime/Applicators/UI/CanvasGroupAlphaApplicator.cs)\n- [UI CanvasGroup - Interactable](./Runtime/Applicators/UI/CanvasGroupInteractableApplicator.cs)\n- [UI CanvasGroup - RaycastTarget](./Runtime/Applicators/UI/CanvasGroupRaycastTargetApplicator.cs)\n- [UI CanvasGroup - Visibility](./Runtime/Applicators/UI/CanvasGroupVisibilityApplicator.cs)\n- [UI Button - Interactable](./Runtime/Applicators/UI/ButtonInteractableApplicator.cs)\n- [UI Image - Enabled](./Runtime/Applicators/UI/ImageEnabledApplicator.cs)\n- [UI Image - Fill Amount](./Runtime/Applicators/UI/ImageFillAmountApplicator.cs)\n- [UI InputField - Text](./Runtime/Applicators/UI/InputFieldApplicator.cs)\n- [UI Slider - Value](./Runtime/Applicators/UI/SliderValueApplicator.cs)\n- [UI Text - Text](./Runtime/Applicators/UI/TextApplicator.cs)\n- [UI TextMeshPro - Text](./Runtime/Applicators/UI/TMPTextApplicator.cs)\n- [UI TextMeshPro - Formatted Text](./Runtime/Applicators/UI/FormattedTMPTextApplicator.cs)\n- [UI TextMeshPro - Localized Text](./Runtime/Applicators/UI/LocalizedTMPTextApplicator.cs)\n- [UI Toggle - IsOn](./Runtime/Applicators/UI/ToggleApplicator.cs)\n\n#### Builtin adapters:\n- [Bool To String](./Runtime/Applicators/Adapters/BoolToStringAdapter.cs)\n- [Bool To Formatted String](./Runtime/Applicators/Adapters/BoolToFormattedStringAdapter.cs)\n- [Formatted Text](./Runtime/Applicators/Adapters/FormattedTextAdapter.cs)\n- [Compare String](./Runtime/Applicators/Adapters/CompareStringAdapter.cs)\n- [Float Format](./Runtime/Applicators/Adapters/FloatFormatAdapter.cs)\n- [Float Ratio](./Runtime/Applicators/Adapters/FloatRatioAdapter.cs)\n- [Inverse Boolean](./Runtime/Applicators/Adapters/InverseBoolAdapter.cs)\n- [Text Localize](./Runtime/Applicators/Adapters/TextLocalizeAdapter.cs)\n- [Time Localize](./Runtime/Applicators/Adapters/TimeLocalizeAdapter.cs)\n\n#### Builtin binders:\n- [UI Button - Click](./Runtime/Binders/UI/ButtonClickBinder.cs)\n- [UI Toggle - ValueChanged](./Runtime/Binders/UI/ToggleValueChangedBinder.cs)\n- [UI Slider - ValueChanged](./Runtime/Binders/UI/SliderValueChangedBinder.cs)\n- [UI InputField - TextChanged](./Runtime/Binders/UI/InputFieldTextChangedBinder.cs)\n- [UI InputField - EndEdit](./Runtime/Binders/UI/InputFieldEndEditBinder.cs)\n\n## How to Install\nMinimal Unity Version is 2020.1.\n\nLibrary distributed as git package ([How to install package from git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html))\n\u003cbr\u003eGit URL: `https://github.com/codewriter-packages/View-Binding.git`\n\n## License\n\nView-Binding is [MIT licensed](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewriter-packages%2Fview-binding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewriter-packages%2Fview-binding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewriter-packages%2Fview-binding/lists"}