GithubHelp home page GithubHelp logo

nick-sec3 / solplay_unity_sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from woody4618/solplay_unity_sdk

0.0 0.0 0.0 20.55 MB

An SDK that lets you connect to phantom wallet, list NFTs, Swap Tokens, Unlock content with NFTs and interact with any anchor program. Build on top of the Garbles Unity SDK.

License: MIT License

Shell 0.05% JavaScript 0.12% C 0.06% Objective-C 6.38% C# 90.99% Rust 0.27% CSS 0.03% HTML 0.28% HLSL 0.27% ShaderLab 1.54%

solplay_unity_sdk's Introduction

Solana Unity Game Examples

A unity frame work build on top of the Solana Unity SDK with 4 example games.

Follow me on Twitter for more frequent updates: @SolPlay_jonas

  1. To use it in your game just include in the Unity Package manager: https://github.com/garbles-labs/Solana.Unity-SDK.git#v0.0.6 in your unity package manager.

  2. Import this unity package (Version 0.0.14 alpha) solplay_0_14.unitypackage.zip and then import it in Unity Assets->importPackage.

Some function may not work with the standart MainNet RPC. You may want to get a free RPC from quicknode or helius.xyz. Also currently its hard to get DevNet sol, so if the automatic airdrops fail you may need to try a few times, try different RPC in the WalletHolderService or transfer dev net sol to your Wallet or use solfaucet.com. (The publickey will be logged in the console on login)

  1. Optional: Import Glftfast for 3D NFT support GlFAst Installer Also add the precompiler flag #GLTFAST

Here are the live versions for the example games:

All game examples work in WebGL using the Phantom browser extension and an mobile using phantom deeplinks. They all come with the Anchor code and Tiny Adventure one and two are also available as tutorials in the Solana Playground here: https://beta.solpg.io/tutorials/

Here is a Video which explains the process step by step: (A bit out dated, you can now skip the step 3) https://www.youtube.com/channel/UC517QSv61gMaABWIJ412_Lw/videos

Release notes: 0.0.13 Alpha

  • Examples tiny adventure and tiny adventure two
  • Bug fixes
  • Removed the SolPlay fork since the unity sdk now has WebSockets as well

0.0.12 Alpha

  • Source code for the Realtime Multiplayer Battle Royal game SolHunter
  • Bug fixes

0.0.9 Alpha

  • Faster NFt loading by seperating Json from the Image loading and using UniTasks to yield tasks in WebGL
  • Socket connection now works with all RPC providers I know. Check out the SolPlaySocketService
  • All folders are not within the SolPlay folder to have less clutter in the root folder
  • Tiny AdvenureTutorial Anchor example client (https://beta.solpg.io/tutorials/tiny-adventure)
  • Source code of SolHunter realtime multiplayer game
  • Made GLTFast dependency optional: Add GLTFAST compiler flag and install the package to use it

If you want to participate, it's very welcome.

Packages used:

Native WebSockets by Endel: https://github.com/endel/NativeWebSocket

WebSocketSharp: https://github.com/sta/websocket-sharp

Epic Toon FX: https://assetstore.unity.com/packages/vfx/particles/epic-toon-fx-57772

glTFast for runtime loading of 3D NFTs: https://github.com/atteneder/glTFast

Lunar console (Get the pro version here: https://github.com/SpaceMadness/lunar-unity-console Pro Version: https://assetstore.unity.com/packages/tools/gui/lunar-mobile-console-pro-43800)

Garbels unity solana sdk. Check out their awesome game as well! Vr Pokemon! https://github.com/garbles-dev/Solana.Unity/tree/master/src

Solanart: https://github.com/allartprotocol/unity-solana-wallet

Tweetnacl (removed): https://github.com/dchest/tweetnacl-js/blob/master/README.md#random-bytes-generation

Gif loading: https://github.com/3DI70R/Unity-GifDecoder

Flappy Bird Game: https://github.com/diegolrs/Flappy-Bird

Unity Ui Extensions: https://github.com/JohannesDeml/unity-ui-extensions.git

UniTask to be able to have delays in WebGL: https://github.com/Cysharp/UniTask/releases

Unity mainThread dispatcher to be able to call unity function from socket messages: https://github.com/PimDeWitte/UnityMainThreadDispatcher

Anchor to C# code generation https://github.com/garbles-labs/Solana.Unity.Anchor https://github.com/bmresearch/Solnet.Anchor/

So far the repository is only tested in IOS mobile, Android and WebGL.

Done:

  • Realtime Multiplayer Battle Royal game in the examples including Anchor code
  • Login and getting Public key from phantom
  • Loading and caching NFTs
  • Nft meta data parsing + power level calculation
  • Deeplink to minting page
  • Deeplink to raydium token swap
  • Transactions
  • In game token and sol amount loading widget
  • WebGL support
  • IOS Support
  • Android Support
  • Smart contract interaction
  • Token swap using Orca WhirlPools
  • Minting NFTs using metaplex (Without candy machine)
  • Minting NFTs (from candy machine V2)
  • Socket connection so listen to account updates
  • Faster NFT loading by seperating the json loading from loading the images and starting multipl at the same time with a smaller rate limit
  • Two anchor example games with source code here: https://beta.solpg.io/tutorials/
  • 3D NFts using GLTF fast. Needs to have a glb file in the animation url of the NFT
  • InGame auto approve wallet. Check our the SolHunter example for how it works.

Next up Todo:

  • Animated Gifs
  • Minting NFTs (from candy machine V2 with white list tokens)
  • Maybe Staking?
  • What else would you like?
  • Try back porting the socket solution to the Garbles SDK to be able to use StreamingRPCs
  • Tiny Adventure Two example

solplay_unity_sdk's People

Contributors

woody4618 avatar nick-sec3 avatar zenrepublic 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.