$ show magicblock-labs/Solana.Unity-SDK
This is the Solana.Unity-SDK, a comprehensive Unity package for integrating Solana blockchain functionality into games and applications. It provides multiple wallet connection methods (in-game wallet, Web3Auth social login, Phantom/Solflare deep links, Mobile Wallet Adapter for Android, WebGL browser wallets), transaction signing, NFT minting via Metaplex Candy Machines (including a full editor toolchain for deployment), DEX swap aggregation (Jupiter), domain resolution (.skr), and cross-platform compatibility (Android, iOS, WebGL). The SDK bundles its own async infrastructure (UniTask 2.5.0) and includes sample UI screens for a wallet application. It is architectured around a central Web3 singleton, an abstract WalletBase class with concrete implementations, and platform-specific adapter classes. The codebase is well-structured with clear separation of concerns, but suffers from some monolithic classes (e.g., Web3Auth, CandyMachineController) and reliance on hardcoded endpoints and program IDs. The editor tools are fully functional but tightly coupled to the UnityEditor API. Overall, it is a professional-grade SDK with moderate reusability of its individual components.
The LLM identified 4 files worth highlighting for reuse:
A complete, self-contained GIF decoder that reads GIF87a/89a files from streams, byte arrays, or file paths. It produces frames as Color32[] arrays, handles LZW decompression, interlacing, disposal methods, and metadata (comments, extensions). It is highly reusable in any Unity project requiring GIF playback without external dependencies, as it has no references to other internal modules.
Implements the IMwaWalletSelectionCache interface using Unity's PlayerPrefs for persistent storage of the last chosen mobile wallet package name. It is a clean, extracted data access component that can be reused in any Unity project needing simple cached string preferences, and demonstrates the interface-separation pattern for testability.
A simple MonoBehaviour that queues actions to be executed on the Unity main thread using a lock and coroutine. It provides a static Run(Action) method and is completely independent of the rest of the SDK. This is a common pattern for Unity projects requiring thread-safe main-thread dispatching, easily extracted with zero modifications.
A reusable screen manager for Unity UI that uses stacks to manage ISimpleScreen transitions (push, pop, replace). It uses a canvas group for fading and a mask for navigation. It is loosely coupled (depends only on the ISimpleScreen interface) and can be extracted into any Unity project that needs modal-like screen management without a complex framework.