Files
trail-into-darkness-demo/Assets/Code/Platform/DesktopPlatform.cs
Sebastian Bularca ca1e3e8488 A bit of cleaning
2026-06-18 23:59:35 +02:00

36 lines
1.2 KiB
C#

using Nox.Input;
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<DesktopPlatformSettings>(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() { }
}
}