Prevent non-Windows system trying to initialize WindowsPointerHandler.
This commit is contained in:
@@ -31,6 +31,8 @@ namespace Cryville.Common.Unity.Input {
|
||||
public WindowsPointerHandler() {
|
||||
if (Instance != null)
|
||||
throw new InvalidOperationException("WindowsPointerHandler already created");
|
||||
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
|
||||
throw new NotSupportedException("Windows pointer is not supported on this device");
|
||||
Instance = this;
|
||||
usePointerMessage = true;
|
||||
|
||||
@@ -142,9 +144,11 @@ namespace Cryville.Common.Unity.Input {
|
||||
}
|
||||
|
||||
public override void Dispose(bool disposing) {
|
||||
Deactivate();
|
||||
if (usePointerMessage)
|
||||
NativeMethods.EnableMouseInPointer(false);
|
||||
if (disposing) {
|
||||
Deactivate();
|
||||
if (usePointerMessage)
|
||||
NativeMethods.EnableMouseInPointer(false);
|
||||
}
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user