Giter Club home page Giter Club logo

unity-example's Introduction

unity-example

Setup a Unity demonstration utilizing Crossmint in just a few minutes!

This example showcases Crossmint's Custodial Wallets and Minting ability.

This isn't a game but rather just a simple menu to demonstrate the ability you have using Crossmint in your own personal game/project.

1. Grab your Crossmint keys

We have two environments, one for testing and one for release. These environments are selected based on the subdomain you select. staging.crossmint.com is the testing environment and www.crossmint.com is the release environment. Throughout this tutorial, we will be using the staging subdomain (testing environment). These steps are identical for either environments with the only difference being the domain you're using.

In the Crossmint console

  1. Go to staging.crossmint.com/console and follow the steps to create an account.

  2. Navigate to API keys and click on New API Key. Then check the nfts.mint, wallets.read, wallets.create and wallets:nfts.read scopes -- this will give your API key permission to create and manage crypto wallets and mint for your users. Finally save your new key and copy the CLIENT SECRET and Project ID values for later.

On your machine

Open the BackendServer project, rename the .env.template file to .env.

In the .env file, fill in the fields with your information gathered from the Crossmint console (CROSSMINT_X_CLIENT_SECRET and CROSSMINT_X_PROJECT_ID).

The result should look something like this:

CROSSMINT_BASEURL=https://staging.crossmint.com
CROSSMINT_X_CLIENT_SECRET=YOUR_CROSSMINT_CLIENT_SECRET_HERE
CROSSMINT_X_PROJECT_ID=YOUR_CROSSMINT_PROJECT_ID_HERE
CROSSMINT_CHAIN="polygon"
CROSSMINT_COLLECTION_ID="default-polygon"
PORT=3000

You can now modify the chain, collection and port to your desired values.

And then save.

Please note: make sure the client secret doesn't get leaked, as it would allow others to create wallets for your users.

2. Configure the BackendServer project

  1. Open index.js and configure the project based on the instructions presented in the authentication method on line 9.

  2. Start the server by running the following command in the BackendServer directory:

node index.js

3. Configure Unity

  1. Open the project in Unity Editor (the project was created on 2021.3.21f1)

  2. Open the C# project (Assets -> Open C# Project)

  3. Open Config.cs and update the BackendServer url.

  4. Ensure the BackendServer is running and start the game!

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.