forked from Shardstone/trail-into-darkness
First commit on my server, yey!
This commit is contained in:
33
Assets/Code/Platform/UnityEditorPlatform.cs
Normal file
33
Assets/Code/Platform/UnityEditorPlatform.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Nox.Input;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Nox.Platform {
|
||||
public class UnityEditorPlatform : IPlatform {
|
||||
private readonly AssetReference assetReference;
|
||||
private UnityEditorPlatformSettings editorPlatformSettings;
|
||||
|
||||
public UnityEditorPlatform(AssetReference assetReference) {
|
||||
this.assetReference = assetReference;
|
||||
}
|
||||
public PlatformSettings PlatformSettings => editorPlatformSettings;
|
||||
public IEnumerator Initialize(object applicationData) {
|
||||
var handle = Addressables.LoadAssetAsync<UnityEditorPlatformSettings>(assetReference);
|
||||
yield return new WaitUntil(() => handle.IsDone);
|
||||
editorPlatformSettings = handle.Result;
|
||||
Debug.Log($"Device Platform {editorPlatformSettings.devicePlatform} initialized");
|
||||
InitializeInput();
|
||||
}
|
||||
|
||||
public IInput InitializeInput() {
|
||||
var inputHandler = new EditorInput(editorPlatformSettings);
|
||||
inputHandler.Initialize();
|
||||
return inputHandler;
|
||||
}
|
||||
public void Tick() { }
|
||||
public void Dispose() { }
|
||||
|
||||
public void OnApplicationQuit() { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user