
描述
Web3Toolkit is a lightweight, Nethereum-based Unity toolkit that lets you wire up Web3 basics in minutes—connect with a developer key, run personal_sign, read native balance, and send the chain’s native coin—on Local/Hardhat, testnets (Sepolia, Base Sepolia, Polygon Amoy), and mainnets (Ethereum, Base, Polygon). It ships with a plug-and-play HUD prefab, a demo scene, IL2CPP-safe link.xml, and Editor menus to streamline setup. No SaaS—you control RPCs and keys.
NetworksLocal: Hardhat (31337)
Testnets: Sepolia (11155111), Base Sepolia (84532), Polygon Amoy (80002)
Mainnets: Ethereum (1), Base (8453), Polygon (137)
Full C# runtime under AnvilInteractiveSolutions.Web3Toolkit
Demo scene Web3Toolkit_Demo.unity (lighting data included)
Web3ToolkitHUD.prefab (drop-in UI)
Runtime: IWallet, WalletController, DevWallet, BalanceService, NetSelect, Web3Rpc, NetExplorer, NetFaucet, Chains
Editor: Docs & setup menus (Open Docs, Install/Launch NuGet, Enable/Disable Toolkit)
Web3Toolkit.asmdef + link.xml
Extras: NuGetForUnity.4.5.0.unitypackage (bundled helper)
Docs: README.md, full PDF manual, CHANGELOG.md, LICENSE, ThirdPartyNotices.txt
Inspector Network dropdown: Local / Sepolia / Base Sepolia / Amoy / Ethereum / Base / Polygon
Dev-key connect, personal_sign, native balance, send native coin
Explorer links (Etherscan/Basescan/Polygonscan) & Faucet helper for testnets
Optional gas estimate before sending
IL2CPP-ready (link.xml), assembly-def structured, single namespace
Clean interfaces; easy to extend with ERC-20/721 using Nethereum
Unity 2021.3+
Player → Other Settings: API Compatibility = .NET Standard 2.1, Managed Stripping = Low
Android: Internet Access = Require
Exactly one Newtonsoft.Json (either Unity’s package or NuGet—do not keep both)
Tools → Web3Toolkit → Dependencies → Install NuGetForUnity (imports the bundled unitypackage; editor reloads).
Tools → Web3Toolkit → Dependencies → Open NuGet Manager → install Nethereum.Web3.
Tools → Web3Toolkit → Setup → Enable Web3Toolkit (after installing Nethereum).
Open Assets/AnvilInteractiveSolutions/Web3Toolkit/Demo/Web3Toolkit_Demo.unity.
In the demo UI, set Network = Sepolia.
Paste a faucet-funded test private key → Connect (address & balance appear).
Sign → Console logs sig=0x… and match=True.
Enter To Address + Amount (e.g., 0.001) → Send → explorer opens with the tx hash.
Wallet login via signed message (server verifies personal_sign)
QA/dev flows with dev keys on Local/testnets
Native-coin micro-payments on L2 (Base/Polygon)
Token-gating & passes (extend with ERC-20/721 via Nethereum)
WalletConnect or custodial wallet adapters (roadmap)
Token/NFT UI in the shipped demo (intentionally focused on wallet + native coin)
Never ship real private keys in consumer builds—use throwaway/test keys.
Include nonce & short expiry in signed messages to avoid replay.
Keep only one Newtonsoft.Json.

