{"id":19610780,"url":"https://github.com/onflow/unityflowsdk","last_synced_at":"2025-04-27T22:33:05.142Z","repository":{"id":84600692,"uuid":"576309455","full_name":"onflow/UnityFlowSDK","owner":"onflow","description":"Flow SDK for Unity - build Unity games on the Flow blockchain","archived":false,"fork":false,"pushed_at":"2023-11-27T00:44:32.000Z","size":18919,"stargazers_count":14,"open_issues_count":3,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-05T04:07:44.852Z","etag":null,"topics":["blockchain","flow","sdk","unity"],"latest_commit_sha":null,"homepage":"https://developers.flow.com/tools/unity-sdk","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/onflow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-12-09T14:18:59.000Z","updated_at":"2025-03-15T23:37:03.000Z","dependencies_parsed_at":"2023-11-27T01:43:43.734Z","dependency_job_id":null,"html_url":"https://github.com/onflow/UnityFlowSDK","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2FUnityFlowSDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2FUnityFlowSDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2FUnityFlowSDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2FUnityFlowSDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onflow","download_url":"https://codeload.github.com/onflow/UnityFlowSDK/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219600,"owners_count":21554444,"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":["blockchain","flow","sdk","unity"],"created_at":"2024-11-11T10:33:25.211Z","updated_at":"2025-04-27T22:33:00.123Z","avatar_url":"https://github.com/onflow.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flow SDK for Unity\n\nWelcome to the Flow SDK for Unity. This SDK allows Unity developers to integrate their games and apps with the Flow blockchain. Some of the things you can do include: \n\n- Mint, burn and trade NFTs and Fungible Tokens\n- Store game data on-chain\n- Read any public data on Flow\n- Execute game logic on-chain\n\nYou can run your game completely on-chain, or go with a mixed on-chain\\off-chain architecture. \n\n## Overview\n\nThe SDK is comprised of two parts:\n\nThe **DapperLabs.Flow.Sdk** namespace\n\nThis namespace contains pure C# functions that can be used by any .NET program.  It contains the low level primitives needed to connect to and interact with the Flow blockchain.\n\nThe **DapperLabs.Flow.Sdk.Unity** namespace\n\nThis namespace provides Unity specific helper functions and utilities to make developing Unity apps that run on Flow easier.  It offers an account-centric model of interacting with the Flow network.  \n\n### Which should I use?\nYou can use either, or both, depending on your needs.\nThe base Flow SDK offers more control and more features such as allowing for multi-party signing of transactions.\nFlowControl offers a simpler workflow for the most commonly used features (executing scripts and single party transactions).\n\nA typical Flow SDK transaction submittal would look like:\n\n- Construct an SdkAccount object\n- Connect to the desired network\n- Execute a transaction using the Submit function, passing in the script, arguments and accounts to use.\n- Wait until transaction is submitted.\n- Check for errors.\n- Get the Transaction ID of the submitted transaction.\n- Poll the blockchain to determine when the transaction finishes executing to get its status and associated events.\n- Check for errors.\n- Process any events as required.\n\nUsing FlowControl it would look like:\n\n- Construct a FlowControl account (either in code or via GUI)\n- Use the account to submit the transaction (`account.SubmitAndWaitUntilSealed`)\n- Wait until the transaction returns.\n- Check for errors.\n- Process any events as required.\n\nUnder the hood, FlowControl handles connecting to the network associated with the account, submitting the transaction, and polling to determine when the transaction has finished executing.\n\nYou can use FlowControl for the majority of things and the Flow SDK for advanced functionality not provided by FlowControl.   \n\n### Asynchronous programming\nBecause response times when interacting with the blockchain can take seconds, functions that interact with the chain will usually return asyncronous Tasks.  A common pattern for asyncronous programming in Unity is to use Coroutines to wait until the Task completes and act upon it.\n\nExample:\n\n```\nvoid Start()\n{\n    StartCoroutine(DoQuery());\n}\n\nIEnumerator DoQuery()\n{\n    Task\u003cFlowScriptResponse\u003e task = account.ExecuteScript(queryScript.text);\n    yield return new WaitUntil(()=\u003etask.IsCompleted)\n    \n    if(task.Result.Error == null)\n    {\n        Debug.Log(task.Result.Value.As\u003cCadenceString\u003e().Value);\n    }\n    else\n    {\n        Debug.Log($\"Error executing script: {task.Result.Error.Message}\");\n    }\n}\n```\n\n### FlowControl\n\nThe FlowControl component and editor window is the heart of the Unity editor integration.  \n\nSee the [Flow Control documentation](https://developers.flow.com/tools/unity-sdk/guides/flow-control) for more information.\n\n## Requirements\n\nThe Flow SDK for Unity requires **Unity 2021.3** or later. The following platforms are currently supported: \n\n- Windows\n- MacOS\n- Android\n- iOS\n\n## Documentation\n\nFull documentation for the Flow SDK for Unity can be found [here](https://developers.flow.com/tools/unity-sdk). \n\n[Flow Control](https://developers.flow.com/tools/unity-sdk/guides/flow-control)\n\n[Sample - Flow SDK Usage](https://developers.flow.com/tools/unity-sdk/samples/ui-usage)\n\n[Tutorial - How to build Flow Words game](https://developers.flow.com/tools/unity-sdk/samples/flow-words-tutorial)\n\n[API Reference](https://unity-flow-sdk-api-docs.vercel.app/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Funityflowsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonflow%2Funityflowsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Funityflowsdk/lists"}