Skip to content

Commit

Permalink
Merge branch 'v5' of https://github.com/thirdweb-dev/unity into v5
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed Jan 15, 2025
2 parents 056f436 + 7aa8665 commit f1179d8
Showing 1 changed file with 48 additions and 62 deletions.
110 changes: 48 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,51 @@
![Thirdweb Unity SDK](https://github.com/thirdweb-dev/unity-sdk/assets/43042585/0eb16b66-317b-462b-9eb1-9425c0929c96)

[<img alt="Unity Documentation" src="https://img.shields.io/badge/Unity-Documentation-blue?logo=unity&style=for-the-badge" height="30">](https://portal.thirdweb.com/unity/v5)
[<img alt=".NET Documentation" src="https://img.shields.io/badge/.NET-Documentation-purple?logo=dotnet&style=for-the-badge" height="30">](https://portal.thirdweb.com/dotnet)
<p align="center">
<strong>All-In-One Cross-Platform Blockchain Unity SDK for Browser, Standalone, Mobile and Server Targets.</strong>
</p>

<p align="center">
<a href="https://portal.thirdweb.com/unity/v5">
<img alt="Unity Documentation" src="https://img.shields.io/badge/Unity-Documentation-blue?logo=unity&style=for-the-badge" height="30">
</a>
<a href="https://portal.thirdweb.com/dotnet">
<img alt=".NET Documentation" src="https://img.shields.io/badge/.NET-Documentation-purple?logo=dotnet&style=for-the-badge" height="30">
</a>
</p>

# Technical Demo

Experience our multichain game demo leveraging In-App Wallets and Account Abstraction built in three weeks - [Web3 Warriors](https://web3warriors.thirdweb.com/).

![image](https://github.com/thirdweb-dev/unity-sdk/assets/43042585/171198b2-83e7-4c8a-951b-79126dd47abb)

# Features

This SDK provides a Unity-first integration of all [thirdweb](https://thirdweb.com) functionality, including but not limited to:

- Support for all target platforms, Unity 2022 & Unity 6.
- First party support for [In-App Wallets](https://portal.thirdweb.com/connect/wallet/overview) (Guest, Email, Phone, Socials, Custom Auth+).
- First party support for [Account Abstraction](https://portal.thirdweb.com/connect/account-abstraction/overview) (Both EIP-4337 & zkSync Native AA).
- Instant connection to any chain with RPC Edge integration.
- Integrated IPFS upload/download.
- Easy to extend or wrap.
- High level contract extensions for interacting with common standards and thirdweb contract standards.
- Automatic ABI resolution.
- Build on top of thirdweb's [.NET SDK](https://portal.thirdweb.com/dotnet) - unity package updates are typically updates to a single DLL/a file or two.
- Get started in 5 minutes with a simple [ThirdwebManager](https://portal.thirdweb.com/unity/v5/thirdwebmanager) prefab.

# Supported Platforms & Wallets

**Build games for WebGL, Desktop, and Mobile using 1000+ supported chains, with various login options!**
**Build games for Web, Standalone, and Mobile using 2000+ supported chains, with various login options!**

| Wallet Provider | WebGL | Desktop | Mobile |
| ----------------------------------------- | :---: | :-----: | :----: |
| **In-App Wallet** (Email, Phone, Socials, Custom) | ✔️ | ✔️ | ✔️ |
| **Ecosystem Wallet** (IAW w/ partner permissions) | ✔️ | ✔️ | ✔️ |
| **Private Key Wallet** (Guest Mode) | ✔️ | ✔️ | ✔️ |
| **Wallet Connect Wallet** (400+ Wallets) | ✔️ | ✔️ | ✔️ |
| **MetaMask Wallet** (Browser Extension) | ✔️ |||
| **Smart Wallet** (Account Abstraction) | ✔️ | ✔️ | ✔️ |
| Wallet Provider | Web | Standalone | Mobile |
| ------------------------------------------------------------ | :---: | :-----: | :----: |
| **In-App Wallet** (Guest, Email, Phone, Socials, Custom) | ✔️ | ✔️ | ✔️ |
| **Ecosystem Wallet** (IAW w/ partner permissions) | ✔️ | ✔️ | ✔️ |
| **Private Key Wallet** (Ephemereal, good for testing) | ✔️ | ✔️ | ✔️ |
| **Wallet Connect Wallet** (400+ Wallets) | ✔️ | ✔️ | ✔️ |
| **MetaMask Wallet** (Browser Extension) | ✔️ |||
| **Smart Wallet** (Account Abstraction: 4337 & ZkSync Native) | ✔️ | ✔️ | ✔️ |

<sub>✔️ Supported</sub> &nbsp; <sub>❌ Not Supported</sub> &nbsp; <sub>— Not Applicable</sub>

Expand All @@ -30,63 +55,24 @@ Experience our multichain game demo leveraging In-App Wallets and Account Abstra
2. **Explore:** Try out `Scene_Playground` to explore functionality and get onboarded.
3. **Learn:** Explore the [Unity v5 SDK Docs](https://portal.thirdweb.com/unity/v5) and the [.NET SDK Docs](https://portal.thirdweb.com/dotnet) to find a full API reference.

**Notes:**
## Miscellaneous

- Tested on Unity 2021.3+, 2022.3+, Unity 6 Preview. We recommend using 2022 LTS.
- Newtonsoft and EDM4U are included utilities; deselect if already installed to avoid conflicts.
- Recommended Unity Editor Version: 2022.3+ (LTS)
- Newtonsoft.Json and EDM4U are included utilities; deselect when importing if already installed to avoid conflicts.
- If using .NET Framework and encountering `HttpUtility` errors, create `csc.rsp` with `-r:System.Web.dll` under `Assets`.
- Use version control and test removing duplicate DLLs if conflicts arise.
- Use version control and test removing duplicate DLLs if conflicts arise. Our SDK generally works with most versions of the few dependencies we do include.
- To use your own WalletConnect Project ID, edit `Assets/Thirdweb/Plugins/WalletConnectUnity/Resources/WalletConnectProjectConfig.asset`.

# Build Instructions

## General

- **Build Settings:** Use `Smaller (faster) Builds` / `Shorter Build Time`.
- **Player Settings:** Use IL2CPP over Mono when available.
- **Stripping Level:** Set `Managed Stripping Level` to `Minimal` (`Player Settings` > `Other Settings` > `Optimization`). (Generally not a hard requirement unless using WalletConnect as a wallet provider option.)
- **Strip Engine Code:** Make sure this is turned off.

## WebGL

- **WebGL Template:** None enforced, feel free to customize!
- **Compression Format:** Set to `Disabled` (`Player Settings` > `Publishing Settings`) for final builds.
- **Testing WebGL Social Login Locally:** Host the build or run it locally with `Cross-Origin-Opener-Policy` set to `same-origin-allow-popups`.

Example setup for testing In-App or Ecosystem Wallet Social Login locally (no longer required with Unity 6 Web, can use Build & Run):

```javascript
// YourWebGLOutputFolder/server.js
const express = require("express");
const app = express();
const port = 8000;

app.use((req, res, next) => {
res.header("Cross-Origin-Opener-Policy", "same-origin-allow-popups");
next();
});

app.use(express.static("."));
app.listen(port, () =>
console.log(`Server running on http://localhost:${port}`)
);

// run it with `node server.js`
```

No action needed for hosted builds.

## Mobile

- **EDM4U:** Comes with the package, resolves dependencies at runtime. Use `Force Resolve` from `Assets` > `External Dependency Manager` > `Android Resolver`.
- **Redirect Schemes:** Set custom schemes matching your bundle ID in `Plugins/AndroidManifest.xml` or equivalent to ensure OAuth redirects.
## Additional Resources

# Migration from v4
- [Documentation](https://portal.thirdweb.com/unity/v5)
- [Templates](https://thirdweb.com/templates)
- [Website](https://thirdweb.com)

See https://portal.thirdweb.com/unity/v5/migration-guide
## Support

# Need Help?
For help or feedback, please [visit our support site](https://thirdweb.com/support)

For any questions or support, visit our [Support Portal](https://thirdweb.com/support).
## Security

Thank you for trying out the Thirdweb Unity SDK!
If you believe you have found a security vulnerability in any of our packages, we kindly ask you not to open a public issue; and to disclose this to us by emailing `security@thirdweb.com`.

0 comments on commit f1179d8

Please sign in to comment.