MOBILE ECOSYSTEM MANAGER
Version: 1.0.0 | Contributor: Mathew | Dependencies: Unity 2022.3+
1. Overview
The Platform Ecosystem Manager is a fully decoupled, event-driven architecture designed to handle Google Play Games Services and Apple GameCenter.
Instead of hardcoding platform APIs into gameplay scripts, this package uses a Central Event Bus. Your game logic simply "shouts" that an event happened (e.g., a boss died), and the Ecosystem Manager quietly listens in the background, translates that event into the correct string ID, and awards the achievement or leaderboard score.
1.1 Key Features v1.1.0
- Zero Dependency Hell: Gameplay scripts do not require references to Google or Apple namespaces.
- No-Code Configuration: Map platform string IDs using a clean ScriptableObject UI.
- Smart Offline Caching: Automatically saves un-submitted high scores locally and flushes them when the internet returns.
- MiniDevTools Integration: Native integration with
DataManager.
2. Installation & Setup
- Drag the
MiniDevTools.EcosystemManagerfolder into your Unity project'sAssetsfolder. - Unity will automatically compile the package via the included
MiniDevTools.EcosystemManager.Runtime.asmdeffile. - In your initial startup scene, create an empty GameObject and name it
[EcosystemManager]. - Attach the
EcosystemManager.csscript to this GameObject.
3. Configuration (The ScriptableObject)
CgkI_12345 for Google or com.studio.ach1 for Apple). Just map them in the Inspector!
- In your Project window, right-click and navigate to Create > Ecosystem > Configuration.
- Name the generated asset
MainEcosystemConfig. - Select the asset. In the Inspector, you will see lists for Achievements and Leaderboards.
- Click
+to add an entry. Select the human-readable Enum name, and paste the specific Android and iOS string IDs provided by the Google Play Console and App Store Connect. - Finally, drag this
MainEcosystemConfigasset into the empty slot on yourEcosystemManagercomponent in the scene.
4. Gameplay Integration
Your gameplay scripts should never reference the EcosystemManager directly. Instead, invoke actions through the static GameEvents hub.
4.1 Unlocking a Standard Achievement
Whenever a milestone is reached in your game, invoke the corresponding event:
using MiniDevTools.EcosystemManager; // Add this to the top of your script
public class BossScript : MonoBehaviour
{
public void OnBossDefeated()
{
// 1. Play your game logic (particles, loot, etc.)
// 2. Shout to the Ecosystem
GameEvents.OnBossPhaseSurvived?.Invoke(1);
}
}
4.2 Submitting a Leaderboard Score
When a run ends, pass the final time (or score) to the event bus: C#
using MiniDevTools.EcosystemManager;
public class PlayerDeath : MonoBehaviour
{
public void EndRun(long totalSecondsSurvived)
{
// The Ecosystem will automatically catch this and submit it to the active platform
GameEvents.OnRunCompletedTime?.Invoke(totalSecondsSurvived);
}
}
5. Adding New Achievements or Leaderboards
When your game expands, you will need to add new milestones.
Open AchievementName.cs or LeaderboardName.cs located in the Enums folder.
Add your new readable name to the list:
public enum AchievementName
{
DriverUnlocked,
BossPhase1Survived,
Score1Million,
TheCompletionist,
FlawlessVictory // <-- New entry added here
}
Open your MainEcosystemConfig ScriptableObject in the Unity Inspector and map the new FlawlessVictory enum to its platform IDs.
Add the routing logic inside EcosystemManager.cs to listen for the specific game event and unlock the achievement.
6. Offline Caching & MiniDevTools
This package includes an OfflineScoreCache. If a player finishes a run without internet access, their score is saved locally.
If the MINIDEVTOOLS_DATAMANAGER scripting define symbol is active in your project (which happens automatically when you run the MiniDevTools Setup), the Ecosystem Manager will bypass standard PlayerPrefs and route all offline caches directly into your custom JSON DataManager storage under the tag EcosystemCache.
If MiniDevTools is not present in the project, the system safely falls back to standard Unity PlayerPrefs to ensure no data is lost.