using System; using System.IO; using UnityEngine; namespace Ubisoft.Hotel.Device { public class NativeDeviceDesktop : INativeDevice { public long GetFreeDiskSpace(string path) { try { foreach (DriveInfo driveInfo in DriveInfo.GetDrives()) { string drive = driveInfo.Name; #if UNITY_EDITOR_WIN drive = drive.Replace('\\', '/'); #endif if (path.StartsWith(drive)) { return driveInfo.AvailableFreeSpace; } } } catch (NotImplementedException) { } return 0; } public AdvertisingInfo GetAdvertisingId() { AdvertisingInfo adInfo = new AdvertisingInfo(); _ = Application.RequestAdvertisingIdentifierAsync( (string advertisingId, bool trackingEnabled, string error) => { if (string.IsNullOrEmpty(error)) { DeviceLogger.Channel.LogInformation($"AdvertisingID {advertisingId} - TrackingEnabled {trackingEnabled}"); adInfo.RequestSuccess = true; adInfo.AdvertisingId = advertisingId; adInfo.TrackingEnabled = trackingEnabled; } else { DeviceLogger.Channel.LogWarning($"Error retrieving AdvertisingID: {error}"); } } ); return adInfo; } public void OpenAppInStore() { OpenAppInStore(Application.identifier); } public void OpenAppInStore(string appId) { Application.OpenURL(appId); } public bool IsLegitInstallation() { return false; } } }