#if HT_PACKAGE_SRDEBUGGER_PROD && HT_CHEATS_ON using System.ComponentModel; using SRDebugger; using UnityEngine; namespace Ubisoft.Hotel.Device.Debug { public class SRDebugOptions : INotifyPropertyChanged { private const string OptionsCategory = "Hotel - Device"; private static readonly SRDebugOptions s_instance = new SRDebugOptions(); public event PropertyChangedEventHandler PropertyChanged; [RuntimeInitializeOnLoadMethod] private static void OnRuntimeMethodLoad() { s_instance.StoreAppId = Application.identifier; SRDebug.Instance?.AddOptionContainer(s_instance); bool isLegit = NativeDevice.Instance.IsLegitInstallation(); s_instance.IsLegitInstallation = isLegit.ToString(); s_instance.InternetReachabilityName = NetworkDriver.InternetReachabilityAsString; } [Category(OptionsCategory), DisplayName("Request Advertising Info"), Sort(1)] public void GetAdvertisingId() { AdvertisingInfo adInfo = NativeDevice.Instance.GetAdvertisingId(); UnityEngine.Debug.Log($"[AdvertisingInfo] Success: {adInfo.RequestSuccess} - Id: {adInfo.AdvertisingId} - Tracking Enabled: {adInfo.TrackingEnabled}"); AdvertisingInfoSuccess = adInfo.RequestSuccess.ToString(); AdvertisingId = string.IsNullOrEmpty(adInfo.AdvertisingId) ? "-" : adInfo.AdvertisingId; AdvertisingTrackingEnabled = adInfo.TrackingEnabled.ToString(); } private string m_advertisingInfoSuccess = "-"; [Category(OptionsCategory), DisplayName("AdvInfo Success?"), Sort(2)] public string AdvertisingInfoSuccess { get { return m_advertisingInfoSuccess; } private set { m_advertisingInfoSuccess = value; OnPropertyChanged("AdvertisingInfoSuccess"); } } private string m_advertisingId = "-"; [Category(OptionsCategory), DisplayName("Advertising ID"), Sort(3)] public string AdvertisingId { get { return m_advertisingId; } private set { m_advertisingId = value; OnPropertyChanged("AdvertisingId"); } } private string m_advertisingTrackingEnabled = "-"; [Category(OptionsCategory), DisplayName("Tracking Enabled?"), Sort(4)] public string AdvertisingTrackingEnabled { get { return m_advertisingTrackingEnabled; } private set { m_advertisingTrackingEnabled = value; OnPropertyChanged("AdvertisingTrackingEnabled"); } } [Category(OptionsCategory), DisplayName("Open App In Store"), Sort(5)] public void OpenAppInStore() { if (string.IsNullOrEmpty(StoreAppId)) { StoreAppId = Application.identifier; } NativeDevice.Instance.OpenAppInStore(StoreAppId); } private string m_storeAppId = "-"; [Category(OptionsCategory), DisplayName("Store App Id"), Sort(6)] public string StoreAppId { get { return m_storeAppId; } set { m_storeAppId = value; OnPropertyChanged("StoreAppId"); } } private string m_isLegitInstallation = "-"; [Category(OptionsCategory), DisplayName("Is Legit Installation"), Sort(7)] public string IsLegitInstallation { get { return m_isLegitInstallation; } private set { m_isLegitInstallation = value; OnPropertyChanged("IsLegitInstallation"); } } // The NumberRange attribute will ensure that the value never leaves the range 0-10 [NumberRange(0, 3)] [Category(OptionsCategory), DisplayName("Internet Reachability"), Sort(8)] public int InternetReachability { get { return NetworkDriver.InternetReachabilityAsInt; } set { NetworkDriver.InternetReachabilityAsInt = value; InternetReachabilityName = NetworkDriver.InternetReachabilityAsString; } } private string m_internetReachabilityName = "-"; [Category(OptionsCategory), DisplayName("Internet Reachability Name"), Sort(9)] public string InternetReachabilityName { get { return m_internetReachabilityName; } private set { m_internetReachabilityName = value; OnPropertyChanged("InternetReachabilityName"); } } private void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } } #endif