com.amanotes.echo.foundation
v1.1.0
Published
Foundation utilities shared by every Echo module: SingletonBehavior, FileDataRepository (atomic JSON persistence), GameMasterTime + vendor-agnostic ServerWorldTime, TimerCounter2/TimerView, UserProfile. Zero vendor-SDK coupling.
Maintainers
Readme
Echo Foundation
Package: com.amanotes.echo.foundation v1.0.0
Unity: 2022.3+
Namespace: Amanotes.Echo.Utils.Foundation (assembly Echo.Utils.Foundation)
Dependencies: com.cysharp.unitask 2.3.3
Foundation utilities shared by every Echo module. Zero vendor-SDK coupling, zero Orchestra coupling — safe to drop into any project, with or without Orchestra installed.
What's inside
| Type | Purpose |
|---|---|
| SingletonBehavior<T> | Auto-bootstrapping DontDestroyOnLoad singleton; finds-or-creates on first access. |
| FileDataRepository<T> | Async JSON persistence under Application.persistentDataPath; atomic write via .tmp + File.Replace with retry/backoff; SaveSync for app-quit paths. |
| GameMasterTime | Tamper-resistant clock: server-time sync + cheat-offset detection. |
| ServerWorldTime | Vendor-agnostic server-time source (WorldTimeAPI → WorldTimeServer fallback). Replaces AmaGDK's GDKUtils.GetServerTime — pure UnityWebRequest, no vendor SDK. |
| TimerCounter2 / TimerView | Countdown timing + TMP display. |
| UserProfile | Lightweight profile holder. |
Quick Start
using Amanotes.Echo.Utils.Foundation;
// Singleton
public class MyManager : SingletonBehavior<MyManager> { }
// Persistence
var repo = new FileDataRepository<MyData>("my_data.json");
MyData data = await repo.LoadAsync();
await repo.SaveAsync(data);
// Tamper-resistant time
DateTime now = GameMasterTime.Instance.CurrentTime;Notes
GameMasterTimeno longer depends on AmaGDK or the Echo SDK; server time is fetched by the in-packageServerWorldTime.GameMasterTimehas no Orchestra dependency — it raises plain C# events (OnAppResumeTimeSynced,OnTimeCheatChanged) instead of dispatching onKEventBus. If the host project uses Orchestra and wants these forwarded ontoKEventBus, run Echo > Foundation > GameMasterTime Setup Wizard to generate and wire aGameMasterTimeBridge(host layer, lives inAssets/_Echo/Scripts/ModulesIntegration/GameMasterTime/).- Every Echo feature module (
com.amanotes.echo.*) depends on this package.
