Unity SDK
Complete guide for integrating StatPotion with Unity games
Last updated: 12/20/2024
Unity Version
Unity 2020.3 LTS or newer
.NET Version
.NET Standard 2.1 support
Initialize StatPotion in your Unity project
Installation: Download StatPotionSDK.cs and place it in your Assets/Scripts folder.
Store player progress with serializable classes
Load dynamic game settings
Track player behavior in your Unity game
Production-ready GameManager with all features
🎮 Mobile (iOS/Android)
Auto-save on application pause/focus lost events for seamless mobile experience.
OnApplicationPause()🖥️ Desktop
Save on significant progress milestones and application quit.
OnApplicationQuit()🌐 WebGL
Consider more frequent auto-saves as users may close browser tabs unexpectedly.
Auto-save🔄 Async/Await
Use async methods for all StatPotion calls. Avoid blocking the main thread.
📱 Network State
Check Application.internetReachability before making requests on mobile.
🚨 Error Handling
Wrap all StatPotion calls in try-catch blocks and provide fallback behavior.