Introducing Hive Keychain for Unity!
I wanted to create an example project to help the community learn how to connect to a Unity project, this should be helpful for game and application developers looking for a easy to setup option.
This is currently an Unity Scene in the simplest form showing you how to Connect and using your username and set it to PlayerPrefs in the Unity Project. There are also some other simple examples but you will have to adjust the code to fit your needs until I build more on this. I Plan to make a simple dapp/ game in the future that I will open source showing how it can be used in more detail but think this is needed in the space to bring more indie developers to the Hive blockchain and will continue to build it out over the next few months.
Here is a snippet of the connect function, pretty simple.
public void ConnectWallet()
{
#if !UNITY_EDITOR && UNITY_WEBGL
GameObject canvas = GameObject.Find("Canvas");
//get text input from usernameInput TextMesh InputField
TMP_InputField usernameInput = canvas.transform.Find("usernameInput").GetComponent<TMP_InputField>();
if (usernameInput.text == "")
{
//create webgl alert
Application.ExternalEval("alert('Username is empty, please enter your hive username & use hive keychain to sign in')");
}
else
{
//if not empty, connect to hive keychain
Debug.Log("Username Sent: " + usernameInput.text);
Connect(usernameInput.text);
}
#endif
}
and a simple transfer
public void Transfer()
{
#if !UNITY_EDITOR && UNITY_WEBGL
Transfer(username, "crypt0gnome", "1", "test xfer unity");
#endif
}
You can view the full repo here and perhaps this should be bookmarked somewhere for users looking to find this in the future.
https://github.com/CryptoGnome/Hive-KeyChain-Unity
If you want to help support me you can check out my other project on Hive or vote for us as wintess here
Leave Introducing Hive Keychain for Unity! to:
Read more #hivedevs posts
Best Posts From Crypt0gnome
We have not curated any of crypt0gnome's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Crypt0gnome
- I'm Powering Up to 100K HP This Year — Here's Why.
- Sabres Even It Up: Buffalo Steals Game 4 in Montreal, Series Heads Back to KeyBank
- Security Alert for All HIVE Devs & Vibecoders: TanStack npm Supply-Chain Compromise
- Holozing Alpha Vials
- How I'm Navigating the Wild World of Bitcoin Mining
- Ethereum's Big Leap: Navigating the ETF Waters and Beyond
- Casting Votes with Care 🤗 - A HIVE Community Member's Guide to Witness Voting
- Feeling Bullish...
- Hive Witness Setup Guide : HIAB Version 1.27.4 [ SELF HOSTED VERSION ]
- New Hive Witness - The Gear & The Goals 🔥
- Hot Takes: What is your favorite thing about $HIVE 👇
- Sometimes I sleep standing up…
- Uncovering the Identity of Satoshi Nakamoto: A Look at the Leading Candidates
- Introducing Hive Keychain for Unity!
- Ethereum 2.0 - Should you stake your ETH?
- Why I created @Splinterboost & How it works!
- Splinterlands Rental Market Analytics | 27-10-2022
- Splinterlands Rental Market Analytics | 26-10-2022
- Splinterlands Rental Market Analytics | 25-10-2022
- Splinterlands Rental Market Analytics | 24-10-2022