Giter Club home page Giter Club logo

wax-unity-sdk's Introduction

WAX SDK for Unity

This package includes base implementation for EOSIO blockchain and several other providers and SDKs all in one:

  • Anchor Link
  • WCW (WAX Cloud Wallet)
  • Atomic Assets
  • EOSIO blockchain

Requirements

As this repo is pre packaging into managed Dlls you are required to install a number of libraries in order for the SDK to function, please install the following packages in the following order using the package manager within Unity as the installer window is added during the packaging stage.

Setup

Here are some additional setup required for specific services.

WAX Cloud Wallet

Example

There is a sample included for Logging into the WAX Cloud Wallet and then Signing transactions using it.

The example is available at Assets/Plugins/WaxUnity/Example

Browser Setup

There are specific integrations included for the WAX Cloud Wallet, because this service requires an embedded browser inside the app or game for login and signing of transactions, you can find these integrations at Plugins/WaxUnity/Integrations.

The included integrations are:

If you're building for WebGL, you can use the WebGL integration to use the browser itself for processing the requests.

Note: The WebGL integration includes a custom template which is required for the integration package to work, so after importing the integration package, make sure to select WaxDefault as template for your WebGL, or if you want to use your own custom template or any other third-party template, make sure to set unityGame variable to unityInstance in the index.html of the template, for example, the Default template does not assign the unityInstance variable to a global variable, so all you need to is to assign the unityGame variable to it which should be defined at the global scope.

Here is a sample:

    var script = document.createElement("script");
    var unityGame; // define the variable at global scope
    script.src = loaderUrl;
    script.onload = () => {
      createUnityInstance(canvas, config, (progress) => {
        progressBarFull.style.width = 100 * progress + "%";
      }).then((unityInstance) => {
        unityGame = unityInstance; // assign unity instance to it
        loadingBar.style.display = "none";
        fullscreenButton.onclick = () => {
          unityInstance.SetFullscreen(1);
        };
      }).catch((message) => {
        alert(message);
      });
    };
    document.body.appendChild(script);

So if you want to use a custom template, make sure to assign the variable called unityGame to unityInstance in order for the integration to work.

Anchor Link

Example

There is a sample included for Logging into the Anchor Link and then Signing transactions using it.

The example is available at Assets/Plugins/AnchorLinkUnity/Example

Customization

You can customize the dialog and other UIs inside the Assets/Plugins/AnchorLinkUnity/Resources/AnchorLink folder using the AnchorLinkCanvas prefab.

The animations are available at Assets/Plugins/AnchorLinkUnity/Animations folder.

Atomic Assets

Example

There are 2 sample included, one is a minimal Get API example and the other one is an Inventory demo.

The examples are available at Assets/Plugins/AtomicAssetsUnityClient/Example

EOS

Example

There are 2 samples included one is for encoding an EOS Signing Request and the other one is for decoding an EOS Signing Request.

The examples are available at Assets/Plugins/EosUnity/Example

Credits

Check the Third Party Notices and Credits for more information.

wax-unity-sdk's People

Contributors

hasanbayatme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.