- ADVENTURE GAME STUDIO TUTORIAL WITH DOWNLOAD HOW TO
- ADVENTURE GAME STUDIO TUTORIAL WITH DOWNLOAD CODE
- ADVENTURE GAME STUDIO TUTORIAL WITH DOWNLOAD DOWNLOAD
String status = await zbdClient.SubscribeWithDrawAsync() 5.Subscribe to a callback method with ID to be monitored
ADVENTURE GAME STUDIO TUTORIAL WITH DOWNLOAD CODE
4.Set the QR code image to image Gameobject Texture2D texs = GenerateQR(lnURL) //Generate QR code image QRcodeText.text = "Congrats! Withdraw " + gamePlayFeeSats + " sats" Logger.Debug("lnURL is not set in withdrawal response.") Private async void handleWithdrawal(WithdrawResponse withdraw) In order to perform a Withdrawal, you will need a similar set of lines of codes but instead of requesting the ZEBEDEE SDK create a payable Charge, you now request for an asynchronous Withdrawal. Logger.Error("payment is not completed:" + status) For example, if the amount paid is not full, do something.the line below just print the status. Once the scene is finished loading, start fading in. StartCoroutine(LoadSceneAndSetActive(startingSceneName)) QRcodeImage.GetComponent().sprite = Resources.Load("image/paid") String status = await zbdClient.SubscribeChargeAsync(chargeId) 5.Subscribe the get notified about payment status QRcodeImage.GetComponent().sprite = Sprite.Create(texs, new Rect(0.0f, 0.0f, texs.width, texs.height), new Vector2(0.5f, 0.5f), 100.0f) 4.Set the QR code Image to image Gameobject Texture2D texs = GenerateQR(boltInvoice) //Generate QR code image String boltInvoice = ĭebug.Log("bolt Invoice is not set in Invoice in reponse.Check the BTCpay server's lightning setup") Private async void handleInvoice(ChargeResponse invoice) Let's also change the width and height of our QRPanel to be 500 for both. In the Inspector view on the right side, in the Rect Transform section, select the anchor presets to middle-center. Under the PersistentCanvas panel, in the Hierarchy section choose to create a UI element ( UI > Panel). Make sure you are in the Persistent Scene file from the Project (Inside Assets/Scenes folder). So let's start of by creating the game interface for displaying a QR Code. This is just a simple integration, it is entirely up to you as the creator of the game to decide what cool interactions can be built around micropayments in your game. Unity | Importing Custom Package Adding QR Code Capabilities Ĭurrently, in order to effect Bitcoin Lightning payments in your game from any mobile and desktop wallet, you must display the invoice request as a QR Code for the player to scan.įor this integration demo, we are going to create a simple paywall inside of the game, where a Player needs to make a payment in order to proceed.
ADVENTURE GAME STUDIO TUTORIAL WITH DOWNLOAD DOWNLOAD
ADVENTURE GAME STUDIO TUTORIAL WITH DOWNLOAD HOW TO
This is a step-by-step guide on how to integrate your Unity game with the ZEBEDEE SDK.
It's difficult to always keep an eye on all external tutorials, but when we find anything useful, we'll include a link below. So when you want to try some more technically tricky things with your game, have a look here! No, not really, but the more advanced / complex features live here.