Class UtilityModule
Shared helpers used internally by all MocaLib modules. Provides structured logging, platform identification, app version access, locale detection, and IAP receipt parsing. Always available — no define guard required.
public static class UtilityModule
- Inheritance
-
UtilityModule
- Inherited Members
Methods
- DelayedCall(float, Action, bool)
Invokes
callbackafterdelayseconds. WhenignoreTimeScaleistrue(default), the wait is based on real time so it is unaffected byTime.timeScalepausing or slow-motion. Whenfalse, Unity's scaled time is used viaAwaitable.WaitForSecondsAsync.
- GetAndroidReceiptSignature(string)
Parses a Unity IAP receipt string (from
order.Info.Receipt) for an Android purchase and returns the Google Play signature.
- GetAppBuildNumber()
Returns the application build number string defined in
GameVersionInfo.BUILD_NUMBER.
- GetAppVersion()
Returns the application version string defined in
GameVersionInfo.BUILD_VERSION.
- GetDeviceLocale()
Returns the device's two-letter ISO 3166 region code (e.g. "US", "TH").
- GetIOSReceiptPayload(string)
Parses a Unity IAP receipt string (from
order.Info.Receipt) for an iOS purchase and returns the raw StoreKit receipt payload.
- GetPlatformFriendlyName()
Returns a human-readable platform name for the current runtime (e.g. "Android", "iOS", "Unity Editor (macOS)").
- GetUTCString()
Returns the device's UTC offset as a formatted string (e.g. "UTC+7", "UTC-5:30").
- Is_iOS_14_5_Or_Higher()
Returns
truewhen running on iOS 14.5 or later. Alwaysfalsein the editor and on non-iOS platforms.
- Is_iOS_17_Or_Higher()
Returns
truewhen running on iOS 17 or later. Alwaysfalsein the editor and on non-iOS platforms.
- MocaLibLog(string, string)
Logs an informational message prefixed with the MocaLib tag and the given module tag.
- MocaLibLogError(string, string)
Logs an error message prefixed with the MocaLib tag and the given module tag.
- MocaLibLogWarning(string, string)
Logs a warning message prefixed with the MocaLib tag and the given module tag.
- NormalizeTrackingEventName(string)
Normalizes an event name to snake_case, stripping non-alphanumeric characters. Used to produce consistent event names across analytics SDKs.