Files
trail-into-darkness/Assets/Code/Core/PlatformSelector.cs
2026-03-19 18:12:07 +01:00

38 lines
990 B
C#

using Nox.Input;
using Nox.Platform;
namespace Nox.Core {
/// <summary>
/// Base class used by the platform factory to select the current platform and the input
/// </summary>
public class PlatformSelector {
public readonly DevicePlatform devicePlatform;
private InputMode inputMode;
public PlatformSelector(DevicePlatform devicePlatform, InputMode inputMode) {
this.devicePlatform = devicePlatform;
this.inputMode = inputMode;
}
public void SetInputMode(InputMode newInputMode) {
inputMode = newInputMode;
}
public static InputMode GetPlatformDefaultInputMode() {
#if UNITY_EDITOR
return InputMode.Editor;
#else
return InputMode.Desktop;
#endif
}
public static DevicePlatform GetDevicePlatform() {
#if UNITY_EDITOR
return DevicePlatform.UnityEditor;
#else
return DevicePlatform.Desktop;
#endif
}
}
}