using Nox.Input; using System.Collections; using System.Threading.Tasks; using UnityEngine; using UnityEngine.AddressableAssets; namespace Nox.Platform { public class DesktopPlatform : IPlatform { private readonly AssetReference assetReference; private DesktopPlatformSettings desktopPlatformSettings; public DesktopPlatform(AssetReference assetReference) { this.assetReference = assetReference; } public PlatformSettings PlatformSettings => desktopPlatformSettings; public async Task Initialize(object applicationData) { var handle = Addressables.LoadAssetAsync(assetReference); await handle.Task; desktopPlatformSettings = handle.Result; Debug.Log($"Device Platform {desktopPlatformSettings.devicePlatform} initialized"); InitializeInput(); } public IInput InitializeInput() { var inputHandler = new DesktopInput(desktopPlatformSettings); inputHandler.Initialize(); return inputHandler; } public void Tick() { } public void Dispose() { } public void OnApplicationQuit() { } } }