{"id":14960975,"url":"https://github.com/kurtdekker/datasacks","last_synced_at":"2025-05-12T17:25:15.736Z","repository":{"id":64917403,"uuid":"142215492","full_name":"kurtdekker/datasacks","owner":"kurtdekker","description":"Tools to make Unity3D UI connections better.","archived":false,"fork":false,"pushed_at":"2024-10-17T19:12:10.000Z","size":1776,"stargazers_count":50,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-12T17:24:43.695Z","etag":null,"topics":["data-abstraction","interoperability","unity3d","unity3d-development","user-interface"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kurtdekker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license_bsd.txt","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":"2018-07-24T21:38:11.000Z","updated_at":"2025-04-13T11:03:09.000Z","dependencies_parsed_at":"2024-04-05T04:23:09.170Z","dependency_job_id":"0e200ea0-854c-4644-b4d0-8580d8ed5552","html_url":"https://github.com/kurtdekker/datasacks","commit_stats":{"total_commits":293,"total_committers":4,"mean_commits":73.25,"dds":"0.39249146757679176","last_synced_commit":"f7eb0f2f0fd6e6a1a366131ad7345bdc8ae0d2d1"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtdekker%2Fdatasacks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtdekker%2Fdatasacks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtdekker%2Fdatasacks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtdekker%2Fdatasacks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurtdekker","download_url":"https://codeload.github.com/kurtdekker/datasacks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253785728,"owners_count":21964019,"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":["data-abstraction","interoperability","unity3d","unity3d-development","user-interface"],"created_at":"2024-09-24T13:23:35.346Z","updated_at":"2025-05-12T17:25:15.704Z","avatar_url":"https://github.com/kurtdekker.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is my datasacks module for easy UI event processing in Unity3D.\n\nIn this Unity project, see the DatasackUsageExamples.txt file for examples.\n\nYou can check out my games here:\n\niPhone:  https://itunes.apple.com/us/developer/kurt-dekker/id680019078\n\nAndroid: https://play.google.com/store/apps/developer?id=Kurt+Dekker\n\nAlso: https://kurtdekker.itch.io/\n\nFor updating your project, see UpdateNotes.txt file.\n\nTHIS PACAKGE REQUIRES UGUI UI PACKAGE! Add this via the Package Mangler\nor else make sure you have this line in your Packages/manifest.json file:\n\n\t\"com.unity.ugui\": \"1.0.0\",\n\n--------------------------------- DATASACKS --------------------------\n\nFire up the example game scene for a silly clicker game that has some UI\nelements that use datasacks for input and output.\n\nHere is a sorta graphical overview of how things work:\n\n![Datasacks Overview 2](https://raw.githubusercontent.com/kurtdekker/datasacks/master/20180724_datasacks_overview.png)\n\nMore examples coming soon. Here are some notes:\n\nWhat are Datasacks?\n\nDatasacks are Unity3D ScriptableObjects that contain data.\n\nInternally the data is stored as a string but you can access it in\ncode as a string, an int, a float, a bool, and other ways.\n\nThe Datasack ScriptableObjects have a custom Unity3D inspector.\nVia a button on that inspector you can \"CODEGEN,\" which will produce\nheader code in (DSMCodegen.cs) containing all the names of the\nDatasacks you have created in your project. This is purely for\ncode convenience and type-checking because you can always get\nat a Datasack by its name (DSM.I.Get( string)), and of course\nthey are always available as draggable objects into Monobehaviors.\n\nINPUT:\n\nThe general flow pattern is that you put the DSUserIntentButton.cs\nscript on any UI button, and when pressed that will put the name\nof that button's GameObject into the DSM.UserIntent variable, unless\nyou specify another Datasack.\n\nOver in code you have a switch statement that operates on the\nname of the button received, and does different things. See below.\n\nDatasacks can be subscribed to for changes, either on a permanent\nlistener basis or on a one-shot basis.\n\nOUTPUT:\n\nFor data presentation, you can put the DSTextGetString.cs onto\nyour UnityEngine.UI.Text components and then the contents of\nany particular Datasack you want will be live-updated to that\nText field.\n\nSee the little clicker game supplied for some sample uses. There\nare other ways. The main point of this is to expose as much\nfunctionality in the Unity editor/inspector as possible, and to\nlet non-engineers make meaningful changes to the game without\nhaving to involve an engineer.\n\nSee notes.txt for what (might be) coming in the future.\n\nOther things you can do with a Datasack can be seen looking at\nits inspector: change values at runtime, display values, etc.\n\nYou can also check the Save boolean to cause it to persist to\nthe PlayerPrefs system between launches of the application.\n\nObviously you can use JSON and store whatever objects you want\ninto the string portion of a Datasack.\n\n\t// Here is an example data subscription pattern for your Monobehavior:\n\t// It falls back to DSM.UserIntent because that is the default sack.\n\n\tpublic Datasack dataSack;\t// populate this in the Unity editor\n\n\tvoid\tOnUserIntent( Datasack ds)\n\t{\n\t\t// Here is where you service the notification\n\t\t// that the contents of this Datasack changed\n\t\t// You can inspect the name of the Datasack if\n\t\t// you expect more than one Datasack to call\n\t\t// this function.\n\t\tswitch( ds.Value)\n\t\t{\n\t\tcase \"ButtonAchievements\":\n\t\t\t// start achievements scene\n\t\t\tbreak;\n\t\tcase \"ButtonPlay\":\n\t\t\t// start playing the game\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tvoid\tOnEnable()\n\t{\n\t\tif (!dataSack) dataSack = DSM.UserIntent;\n\t\tdataSack.OnChanged += OnUserIntent;\n\t}\n\tvoid\tOnDisable()\n\t{\n\t\tdataSack.OnChanged -= OnUserIntent;\n\t}\n\nTextMeshPRO support added!\n\nIf you are using TextMeshPRO you may enable Datasacks to interoperate\nwith the TextMeshPRO objects. To do so you can either make a Scripting\ndefine called USING_TEXTMESHPRO, or else add it into the DSTextAbstraction.cs\nfile directly.\n\nObviously the former approach is better.\n\nScript pre-defines can be added in the Unity Player Settings. Be sure to\npress ENTER after you add the text string or Unity will not save it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurtdekker%2Fdatasacks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurtdekker%2Fdatasacks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurtdekker%2Fdatasacks/lists"}