Prevent non-Windows system trying to initialize WindowsPointerHandler.
This commit is contained in:
@@ -31,6 +31,8 @@ namespace Cryville.Common.Unity.Input {
|
|||||||
public WindowsPointerHandler() {
|
public WindowsPointerHandler() {
|
||||||
if (Instance != null)
|
if (Instance != null)
|
||||||
throw new InvalidOperationException("WindowsPointerHandler already created");
|
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;
|
Instance = this;
|
||||||
usePointerMessage = true;
|
usePointerMessage = true;
|
||||||
|
|
||||||
@@ -142,9 +144,11 @@ namespace Cryville.Common.Unity.Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose(bool disposing) {
|
public override void Dispose(bool disposing) {
|
||||||
Deactivate();
|
if (disposing) {
|
||||||
if (usePointerMessage)
|
Deactivate();
|
||||||
NativeMethods.EnableMouseInPointer(false);
|
if (usePointerMessage)
|
||||||
|
NativeMethods.EnableMouseInPointer(false);
|
||||||
|
}
|
||||||
Instance = null;
|
Instance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user