Move part of the input module to Cryville.Input.

This commit is contained in:
2023-05-05 00:40:51 +08:00
parent b143fb49ce
commit 0b2ea3ddbc
62 changed files with 1417 additions and 1602 deletions

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
xmlns:tools="http://schemas.android.com/tools">
<application>
<activity
android:name="com.unity3d.player.UnityPlayerActivity"
android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
</application>
<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
</manifest>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 10f1d59c7d7d3354c9e06e18c37d6c46
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 1fae26592ef751f47993715f379faed4
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 4328ea0ce04f49844a91172367c83c6c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4406fa823b7746b47a76d810f5bedf6c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,67 @@
using System;
using UnityEngine;
namespace Cryville.Input.Unity.Android {
public abstract class AndroidInputHandler<TSelf> : InputHandler where TSelf : AndroidInputHandler<TSelf> {
protected static TSelf Instance { get; private set; }
readonly IntPtr _t_T;
static readonly jvalue[] _p_void = new jvalue[0];
readonly IntPtr _i_T;
readonly IntPtr _m_T_activate;
readonly IntPtr _m_T_deactivate;
bool _activated;
public AndroidInputHandler(string className) {
if (Instance != null)
throw new InvalidOperationException("AndroidInputHandler already created");
if (Environment.OSVersion.Platform != PlatformID.Unix)
throw new NotSupportedException("Android input is not supported on this device");
Instance = (TSelf)this;
JavaStaticMethods.Init();
var _lt_T = AndroidJNI.FindClass(className);
_t_T = AndroidJNI.NewGlobalRef(_lt_T);
AndroidJNI.DeleteLocalRef(_lt_T);
var _m_T_init = AndroidJNI.GetMethodID(_t_T, "<init>", "()V");
var _li_T = AndroidJNI.NewObject(_t_T, _m_T_init, _p_void);
_i_T = AndroidJNI.NewGlobalRef(_li_T);
AndroidJNI.DeleteLocalRef(_li_T);
var _m_T_getId = AndroidJNI.GetMethodID(_t_T, "getId", "()I");
_m_T_activate = AndroidJNI.GetMethodID(_t_T, "activate", "()V");
_m_T_deactivate = AndroidJNI.GetMethodID(_t_T, "deactivate", "()V");
NativeMethods.AndroidInputProxy_RegisterCallback(
AndroidJNI.CallIntMethod(_i_T, _m_T_getId, _p_void),
Callback
);
}
protected override void Activate() {
if (_activated) return;
_activated = true;
AndroidJNI.CallVoidMethod(_i_T, _m_T_activate, _p_void);
}
protected override void Deactivate() {
if (!_activated) return;
_activated = false;
AndroidJNI.CallVoidMethod(_i_T, _m_T_deactivate, _p_void);
}
public override void Dispose(bool disposing) {
if (disposing) {
Deactivate();
AndroidJNI.DeleteGlobalRef(_i_T);
AndroidJNI.DeleteGlobalRef(_t_T);
}
}
private protected abstract AndroidInputProxy_Callback Callback { get; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ed308f7b1ca3ed443b6eea2559c103c8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,107 @@
using Cryville.Common.Interop;
using Cryville.Common.Logging;
using System;
using System.Text.RegularExpressions;
namespace Cryville.Input.Unity.Android {
public abstract class AndroidSensorHandler<TSelf> : AndroidInputHandler<AndroidSensorHandler<TSelf>> where TSelf : AndroidSensorHandler<TSelf> {
public AndroidSensorHandler(string typeName, byte dimension) : base("world/cryville/input/unity/android/SensorProxy$" + typeName) {
m_typeName = Regex.Replace(typeName, @"(?<=[a-z])(?=[A-Z])", " ");
m_dimension = dimension;
}
public override bool IsNullable => false;
readonly byte m_dimension;
public override byte Dimension => m_dimension;
readonly string m_typeName;
public override string GetTypeName(int type) {
switch (type) {
case 0: return m_typeName;
default: throw new ArgumentOutOfRangeException("type");
}
}
public override double GetCurrentTimestamp() {
return JavaStaticMethods.SystemClock_elapsedRealtimeNanos() / 1e9;
}
private protected sealed override AndroidInputProxy_Callback Callback { get { return OnFeed; } }
[MonoPInvokeCallback]
static void OnFeed(int id, int action, long time, float x, float y, float z, float w) {
try {
double timeSecs = time / 1e9;
Instance.Feed(0, id, new InputFrame(timeSecs, new InputVector(x, y, z, w)));
}
catch (Exception ex) {
Logger.Log("main", 4, "Input", "An error occurred while handling an Android sensor event: {0}", ex);
}
}
}
public class AndroidAccelerometerHandler : AndroidSensorHandler<AndroidAccelerometerHandler> {
public AndroidAccelerometerHandler() : base("Accelerometer", 3) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Length = 1, Time = -2 },
};
public override ReferenceCue ReferenceCue => _refCue;
}
public class AndroidAccelerometerUncalibratedHandler : AndroidSensorHandler<AndroidAccelerometerUncalibratedHandler> {
public AndroidAccelerometerUncalibratedHandler() : base("AccelerometerUncalibrated", 3) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Length = 1, Time = -2 },
};
public override ReferenceCue ReferenceCue => _refCue;
}
public class AndroidGameRotationVectorHandler : AndroidSensorHandler<AndroidGameRotationVectorHandler> {
public AndroidGameRotationVectorHandler() : base("GameRotationVector", 4) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension(),
};
public override ReferenceCue ReferenceCue => _refCue;
}
public class AndroidGravityHandler : AndroidSensorHandler<AndroidGravityHandler> {
public AndroidGravityHandler() : base("Gravity", 3) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Length = 1, Time = -2 },
};
public override ReferenceCue ReferenceCue => _refCue;
}
public class AndroidGyroscopeHandler : AndroidSensorHandler<AndroidGyroscopeHandler> {
public AndroidGyroscopeHandler() : base("Gyroscope", 3) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Time = -1 },
};
public override ReferenceCue ReferenceCue => _refCue;
}
public class AndroidLinearAccelerationHandler : AndroidSensorHandler<AndroidLinearAccelerationHandler> {
public AndroidLinearAccelerationHandler() : base("LinearAcceleration", 3) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Length = 1, Time = -2 },
};
public override ReferenceCue ReferenceCue => _refCue;
}
public class AndroidMagneticFieldHandler : AndroidSensorHandler<AndroidMagneticFieldHandler> {
public AndroidMagneticFieldHandler() : base("MagneticField", 3) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Mass = 1, Time = -2, ElectricCurrent = -1 },
};
public override ReferenceCue ReferenceCue => _refCue;
}
public class AndroidMagneticFieldUncalibratedHandler : AndroidSensorHandler<AndroidMagneticFieldUncalibratedHandler> {
public AndroidMagneticFieldUncalibratedHandler() : base("MagneticFieldUncalibrated", 3) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Mass = 1, Time = -2, ElectricCurrent = -1 },
};
public override ReferenceCue ReferenceCue => _refCue;
}
public class AndroidRotationVectorHandler : AndroidSensorHandler<AndroidRotationVectorHandler> {
public AndroidRotationVectorHandler() : base("RotationVector", 4) { }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension(),
};
public override ReferenceCue ReferenceCue => _refCue;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ad609064283f3454992d6cdc8885110f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
using Cryville.Common.Interop;
using Cryville.Common.Logging;
using System;
namespace Cryville.Input.Unity.Android {
public class AndroidTouchHandler : AndroidInputHandler<AndroidTouchHandler> {
public AndroidTouchHandler() : base("world/cryville/input/unity/android/TouchProxy") { }
public override bool IsNullable => true;
public override byte Dimension => 2;
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Length = 1 },
RelativeUnit = RelativeUnit.Pixel,
Flags = ReferenceFlag.FlipY,
Pivot = new InputVector(0, 1),
};
public override ReferenceCue ReferenceCue => _refCue;
public override string GetTypeName(int type) {
switch (type) {
case 0: return "Android Touch";
default: throw new ArgumentOutOfRangeException("type");
}
}
public override double GetCurrentTimestamp() {
return JavaStaticMethods.SystemClock_uptimeMillis() / 1000.0;
}
private protected override AndroidInputProxy_Callback Callback { get { return OnFeed; } }
[MonoPInvokeCallback]
static void OnFeed(int id, int action, long time, float x, float y, float z, float w) {
try {
double timeSecs = time / 1000.0;
Instance.Feed(0, id, new InputFrame(timeSecs, new InputVector(x, y)));
if (action == 1 /*ACTION_UP*/ || action == 3 /*ACTION_CANCEL*/ || action == 6 /*ACTION_POINTER_UP*/)
Instance.Feed(0, id, new InputFrame(timeSecs));
}
catch (Exception ex) {
Logger.Log("main", 4, "Input", "An error occurred while handling an Android touch event: {0}", ex);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 30eda6ba86d92084f8f038c661147f81
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,3 @@
{
"name": "Cryville.Input.Unity.Android"
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0bb40a8a1701f13479c68e3659a99bfd
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 89dfa18c4a1ae534096094086e3971ee
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,6 @@
package world.cryville.input.unity.android;
final class NativeMethods {
private NativeMethods() { }
public static native void feed(int hid, int id, int action, long time, float x, float y, float z, float t);
}

View File

@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 1796f226463344b48bb9789967b38eda
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
package world.cryville.input.unity.android;
import com.unity3d.player.UnityPlayer;
import com.unity3d.player.UnityPlayerActivity;
import world.cryville.input.unity.android.NativeMethods;
public abstract class Proxy {
protected static UnityPlayerActivity activity;
static int _count;
int _id;
public Proxy() {
if (activity == null) activity = (UnityPlayerActivity)UnityPlayer.currentActivity;
_id = _count++;
}
public int getId() { return _id; }
public abstract void activate();
public abstract void deactivate();
protected void feed(int id, int action, long time) { NativeMethods.feed(_id, id, action, time, 0, 0, 0, 0); }
protected void feed(int id, int action, long time, float x) { NativeMethods.feed(_id, id, action, time, x, 0, 0, 0); }
protected void feed(int id, int action, long time, float x, float y) { NativeMethods.feed(_id, id, action, time, x, y, 0, 0); }
protected void feed(int id, int action, long time, float x, float y, float z) { NativeMethods.feed(_id, id, action, time, x, y, z, 0); }
protected void feed(int id, int action, long time, float x, float y, float z, float w) { NativeMethods.feed(_id, id, action, time, x, y, z, w); }
}

View File

@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: b60db87d680aebd4c8d9071ff17d3a56
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,104 @@
package world.cryville.input.unity.android;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import java.lang.IllegalStateException;
import java.lang.IndexOutOfBoundsException;
import java.util.HashMap;
import java.util.List;
import world.cryville.input.unity.android.Proxy;
public abstract class SensorProxy extends Proxy implements SensorEventListener {
static SensorManager manager;
int dimension;
HashMap<Sensor, Integer> sensors;
List<Sensor> candidateSensors;
public SensorProxy(int type, int dim) throws IllegalStateException, IndexOutOfBoundsException {
if (manager == null) manager = (SensorManager)activity.getSystemService(Context.SENSOR_SERVICE);
dimension = dim;
if (dimension < 0 || dimension > 4) throw new IndexOutOfBoundsException("Invalid dimension");
sensors = new HashMap<Sensor, Integer>();
candidateSensors = manager.getSensorList(type);
if (candidateSensors.size() == 0) throw new IllegalStateException("Sensor not found");
}
@Override
public void activate() {
int workingSensorCount = 0;
for (Sensor sensor : candidateSensors) {
if (manager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_FASTEST)) {
sensors.put(sensor, workingSensorCount++);
}
}
}
@Override
public void deactivate() {
manager.unregisterListener(this);
sensors.clear();
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) { }
@Override
public void onSensorChanged(SensorEvent event) {
Integer id = sensors.get(event.sensor);
if (id == null) return;
float[] v = event.values;
switch (dimension) {
case 0: feed(0, id, event.timestamp); break;
case 1: feed(0, id, event.timestamp, v[0]); break;
case 2: feed(0, id, event.timestamp, v[0], v[1]); break;
case 3: feed(0, id, event.timestamp, v[0], v[1], v[2]); break;
case 4: feed(0, id, event.timestamp, v[0], v[1], v[2], v[3]); break;
}
}
public static class Accelerometer extends SensorProxy {
public Accelerometer() { super(Sensor.TYPE_ACCELEROMETER, 3); }
}
public static class AccelerometerUncalibrated extends SensorProxy {
public AccelerometerUncalibrated() { super(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED, 3); }
}
public static class GameRotationVector extends SensorProxy {
public GameRotationVector() { super(Sensor.TYPE_GAME_ROTATION_VECTOR, 4); }
}
public static class Gravity extends SensorProxy {
public Gravity() { super(Sensor.TYPE_GRAVITY, 3); }
}
public static class Gyroscope extends SensorProxy {
public Gyroscope() { super(Sensor.TYPE_GYROSCOPE, 3); }
}
public static class GyroscopeUncalibrated extends SensorProxy {
public GyroscopeUncalibrated() { super(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, 3); }
}
public static class LinearAcceleration extends SensorProxy {
public LinearAcceleration() { super(Sensor.TYPE_LINEAR_ACCELERATION, 3); }
}
public static class MagneticField extends SensorProxy {
public MagneticField() { super(Sensor.TYPE_MAGNETIC_FIELD, 3); }
}
public static class MagneticFieldUncalibrated extends SensorProxy {
public MagneticFieldUncalibrated() { super(Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED, 3); }
}
public static class RotationVector extends SensorProxy {
public RotationVector() { super(Sensor.TYPE_ROTATION_VECTOR, 4); }
}
}

View File

@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: c1acbb4fd13ca1249880dbc02ff3c9d4
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,49 @@
package world.cryville.input.unity.android;
import android.view.MotionEvent;
import android.view.View;
import com.unity3d.player.UnityPlayer;
import java.lang.reflect.Field;
import world.cryville.input.unity.android.Proxy;
public final class TouchProxy extends Proxy implements View.OnTouchListener {
public TouchProxy() throws NoSuchFieldException, IllegalAccessException, SecurityException {
Field playerField = activity.getClass().getDeclaredField("mUnityPlayer");
playerField.setAccessible(true);
UnityPlayer player = (UnityPlayer)playerField.get(activity);
player.setOnTouchListener(this);
}
boolean activated;
@Override
public void activate() {
activated = true;
}
@Override
public void deactivate() {
activated = false;
}
@Override
public boolean onTouch(View v, MotionEvent event) {
if (!activated) return false;
int pointerCount = event.getPointerCount();
int action = event.getActionMasked();
int actionIndex = event.getActionIndex();
long time = event.getEventTime();
for (int i = 0; i < pointerCount; i++) {
int id = event.getPointerId(i);
float x = event.getX(i);
float y = event.getY(i);
if (action == 5 || action == 6) {
feed(id, i == actionIndex ? action : -1, time, x, y);
}
else {
feed(id, action, time, x, y);
}
}
return false;
}
}

View File

@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 4bd9aa92ec47fbf4fa63a219cfe7e4ce
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,27 @@
using System;
using UnityEngine;
namespace Cryville.Input.Unity.Android {
internal static class JavaStaticMethods {
static bool _init;
static IntPtr _t_SystemClock;
static IntPtr _m_SystemClock_elapsedRealtimeNanos;
static IntPtr _m_SystemClock_uptimeMillis;
static readonly jvalue[] _p_void = new jvalue[0];
public static void Init() {
if (_init) return;
_init = true;
var _lt_SystemClock = AndroidJNI.FindClass("android/os/SystemClock");
_t_SystemClock = AndroidJNI.NewGlobalRef(_lt_SystemClock);
_m_SystemClock_elapsedRealtimeNanos = AndroidJNI.GetStaticMethodID(_lt_SystemClock, "elapsedRealtimeNanos", "()J");
_m_SystemClock_uptimeMillis = AndroidJNI.GetStaticMethodID(_lt_SystemClock, "uptimeMillis", "()J");
AndroidJNI.DeleteLocalRef(_lt_SystemClock);
}
public static long SystemClock_elapsedRealtimeNanos() {
return AndroidJNI.CallStaticLongMethod(_t_SystemClock, _m_SystemClock_elapsedRealtimeNanos, _p_void);
}
public static long SystemClock_uptimeMillis() {
return AndroidJNI.CallStaticLongMethod(_t_SystemClock, _m_SystemClock_uptimeMillis, _p_void);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a5eec7567c416414cad01bedd2b1786b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
using System.Runtime.InteropServices;
namespace Cryville.Input.Unity.Android {
internal delegate void AndroidInputProxy_Callback(int id, int action, long time, float x, float y, float z, float w);
internal static class NativeMethods {
[DllImport("AndroidInputProxy")]
public static extern void AndroidInputProxy_RegisterCallback(int hid, AndroidInputProxy_Callback cb);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d66e4c88d885f4a49bdb1c6b5783281e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: caca3e7f8fad7404eb69b96c39190e02
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,3 @@
{
"name": "Cryville.Input.Unity.Builtin"
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ae5eee924eae80345b704d2b7de05cc0
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Cryville.Input.Unity {
public class UnityGuiInputHandler<T> : InputHandler where T : UnityGuiEventReceiver {
GameObject _receiver;
T _recvComp;
public UnityGuiInputHandler() { }
protected override void Activate() {
_receiver = new GameObject("__guiRecv__");
_recvComp = _receiver.AddComponent<T>();
_recvComp.SetCallback(Feed);
}
protected override void Deactivate() {
if (_receiver) GameObject.Destroy(_receiver);
}
public override void Dispose(bool disposing) {
if (disposing) {
Deactivate();
}
}
public override bool IsNullable { get { return true; } }
public override byte Dimension { get { return 0; } }
readonly static ReferenceCue _refCue = new ReferenceCue { };
public override ReferenceCue ReferenceCue => _refCue;
public override string GetTypeName(int type) {
return _recvComp.GetKeyName(type);
}
public override double GetCurrentTimestamp() {
return Time.realtimeSinceStartupAsDouble;
}
}
public abstract class UnityGuiEventReceiver : MonoBehaviour {
protected Action<int, int, InputFrame> Callback;
protected readonly HashSet<int> Keys = new HashSet<int>();
public void SetCallback(Action<int, int, InputFrame> h) {
Callback = h;
}
public abstract string GetKeyName(int type);
void Awake() {
useGUILayout = false;
}
void Update() {
double time = Time.realtimeSinceStartupAsDouble;
foreach (var k in Keys) {
Callback(k, 0, new InputFrame(time, new InputVector()));
}
}
}
public class UnityKeyReceiver : UnityGuiEventReceiver {
public override string GetKeyName(int type) {
return Enum.GetName(typeof(KeyCode), type);
}
void OnGUI() {
var e = Event.current;
if (e.keyCode == KeyCode.None) return;
double time = Time.realtimeSinceStartupAsDouble;
var key = (int)e.keyCode;
switch (e.type) {
case EventType.KeyDown:
if (!Keys.Contains(key)) {
Callback(key, 0, new InputFrame(time, new InputVector()));
Keys.Add(key);
}
break;
case EventType.KeyUp:
Keys.Remove(key);
Callback(key, 0, new InputFrame(time));
break;
}
}
}
public class UnityMouseReceiver : UnityGuiEventReceiver {
public override string GetKeyName(int type) {
switch (type) {
case 0: return "Mouse Left Button";
case 1: return "Mouse Right Button";
case 2: return "Mouse Middle Button";
default: return string.Format("Mouse Button {0}", type);
}
}
void OnGUI() {
var e = Event.current;
double time = Time.realtimeSinceStartupAsDouble;
var key = e.button;
switch (e.type) {
case EventType.MouseDown:
if (!Keys.Contains(key)) {
Callback(key, 0, new InputFrame(time, new InputVector()));
Keys.Add(key);
}
break;
case EventType.MouseUp:
Keys.Remove(key);
Callback(key, 0, new InputFrame(time));
break;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5d13ae3abab4ed94ca872bc13f466c3f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
using System;
using UnityEngine;
using unity = UnityEngine;
namespace Cryville.Input.Unity {
public class UnityMouseHandler : InputHandler {
GameObject _receiver;
public UnityMouseHandler() {
if (!unity::Input.mousePresent) {
throw new NotSupportedException("Unity mouse is not supported on this device");
}
}
protected override void Activate() {
_receiver = new GameObject("__mouseRecv__");
_receiver.AddComponent<UnityMouseReceiver>().SetHandler(this);
}
protected override void Deactivate() {
if (_receiver) GameObject.Destroy(_receiver);
}
public override void Dispose(bool disposing) {
if (disposing) {
Deactivate();
}
}
public override bool IsNullable { get { return false; } }
public override byte Dimension { get { return 2; } }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Length = 1 },
RelativeUnit = RelativeUnit.Pixel,
};
public override ReferenceCue ReferenceCue => _refCue;
public override string GetTypeName(int type) {
switch (type) {
case 0: return "Mouse Position";
default: throw new ArgumentOutOfRangeException("type");
}
}
public override double GetCurrentTimestamp() {
return Time.realtimeSinceStartupAsDouble;
}
public class UnityMouseReceiver : MonoBehaviour {
UnityMouseHandler _handler;
public void SetHandler(UnityMouseHandler h) {
_handler = h;
}
void Update() {
double time = Time.realtimeSinceStartupAsDouble;
Vector3 pos = unity::Input.mousePosition;
_handler.Feed(0, 0, new InputFrame(time, new InputVector(pos.x, pos.y)));
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a48e9f6f85234594bba5e2a940bb33f2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,70 @@
using System;
using UnityEngine;
using unity = UnityEngine;
namespace Cryville.Input.Unity {
public class UnityTouchHandler : InputHandler {
GameObject _receiver;
public UnityTouchHandler() {
if (!unity::Input.touchSupported) {
throw new NotSupportedException("Unity touch is not supported on this device");
}
}
protected override void Activate() {
_receiver = new GameObject("__touchRecv__");
_receiver.AddComponent<UnityPointerReceiver>().SetHandler(this);
}
protected override void Deactivate() {
if (_receiver) GameObject.Destroy(_receiver);
}
public override void Dispose(bool disposing) {
if (disposing) {
Deactivate();
}
}
public override bool IsNullable { get { return true; } }
public override byte Dimension { get { return 2; } }
readonly static ReferenceCue _refCue = new ReferenceCue {
PhysicalDimension = new PhysicalDimension { Length = 1 },
RelativeUnit = RelativeUnit.Pixel,
};
public override ReferenceCue ReferenceCue => _refCue;
public override string GetTypeName(int type) {
switch (type) {
case 0: return "Touch";
default: throw new ArgumentOutOfRangeException("type");
}
}
public override double GetCurrentTimestamp() {
return Time.realtimeSinceStartupAsDouble;
}
public class UnityPointerReceiver : MonoBehaviour {
UnityTouchHandler _handler;
public void SetHandler(UnityTouchHandler h) {
_handler = h;
}
void Update() {
double time = Time.realtimeSinceStartupAsDouble;
for (int i = 0; i < unity::Input.touchCount; i++) {
var t = unity::Input.GetTouch(i);
Vector2 pos = t.position;
var vec = new InputFrame(time, new InputVector(pos.x, pos.y));
_handler.Feed(0, t.fingerId, vec);
if (t.phase == TouchPhase.Ended || t.phase == TouchPhase.Canceled) {
_handler.Feed(0, t.fingerId, new InputFrame(time));
}
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f94e26b2515ef8840bf1a79800235d8f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 32c723496ecae8c478e5ecbe2635d1b8
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,510 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Cryville.Input</name>
</assembly>
<members>
<member name="T:Cryville.Input.InputEvent">
<summary>
Input event.
</summary>
</member>
<member name="P:Cryville.Input.InputEvent.Identifier">
<summary>
The identifier.
</summary>
</member>
<member name="P:Cryville.Input.InputEvent.From">
<summary>
The input frame last received.
</summary>
</member>
<member name="P:Cryville.Input.InputEvent.To">
<summary>
The new input frame received.
</summary>
</member>
<member name="M:Cryville.Input.InputEvent.ToString">
<inheritdoc />
</member>
<member name="T:Cryville.Input.InputFrameHandler">
<summary>
Represents the method that will handle the <see cref="E:Cryville.Input.InputHandler.OnInput" /> event.
</summary>
<param name="identifier">The identifier of <paramref name="vector" />.</param>
<param name="vector">The new input frame.</param>
</member>
<member name="T:Cryville.Input.InputHandler">
<summary>
Input handler.
</summary>
</member>
<member name="E:Cryville.Input.InputHandler.OnInput">
<summary>
Occurs when a new input frame is sent.
</summary>
</member>
<member name="M:Cryville.Input.InputHandler.Finalize">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputHandler.Dispose">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputHandler.Activate">
<summary>
Activates the input handler and starts receiving new input frames.
</summary>
</member>
<member name="M:Cryville.Input.InputHandler.Deactivate">
<summary>
Deactivates the input handler and stops receiving new input frames.
</summary>
</member>
<member name="M:Cryville.Input.InputHandler.Dispose(System.Boolean)">
<summary>
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
</summary>
<param name="disposing">Whether disposing or finalizing.</param>
</member>
<member name="P:Cryville.Input.InputHandler.IsNullable">
<summary>
Whether null input frames may be sent by the input handler.
</summary>
<remarks>
<para>See <see cref="P:Cryville.Input.InputFrame.IsNull" /> for more information.</para>
</remarks>
</member>
<member name="P:Cryville.Input.InputHandler.Dimension">
<summary>
The dimension of the vectors sent by the input handler.
</summary>
<remarks>
<para>Dimension must be an integer from 0 (inclusive) to 4 (inclusive.) The components of the <see cref="T:Cryville.Input.InputVector" /> whose indices are beyond the dimension should be set to 0.</para>
</remarks>
</member>
<member name="P:Cryville.Input.InputHandler.ReferenceCue">
<summary>
The reference cue for the vectors sent by the input handler.
</summary>
</member>
<member name="M:Cryville.Input.InputHandler.GetTypeName(System.Int32)">
<summary>
Gets the friendly name of the specified type.
</summary>
<param name="type">The type.</param>
<returns>The friendly name of the specified type.</returns>
<remarks>
<para>See <see cref="P:Cryville.Input.InputSource.Type"/> for more information.</para>
</remarks>
</member>
<member name="M:Cryville.Input.InputHandler.GetCurrentTimestamp">
<summary>
Gets the current timestamp of the input handler.
</summary>
<returns>The current timestamp of the input handler in seconds.</returns>
</member>
<member name="M:Cryville.Input.InputHandler.Feed(System.Int32,System.Int32,Cryville.Input.InputFrame)">
<summary>
Sends a new input frame.
</summary>
<param name="type">The type of the input frame.</param>
<param name="identifier">The ID of the input frame.</param>
<param name="frame">The input frame.</param>
</member>
<member name="T:Cryville.Input.InputIdentifier">
<summary>
Input identifier.
</summary>
</member>
<member name="P:Cryville.Input.InputIdentifier.Source">
<summary>
The input source.
</summary>
</member>
<member name="P:Cryville.Input.InputIdentifier.Id">
<summary>
The input ID.
</summary>
<remarks>
<para>This property is used to distinguish different inputs on the input source. For example, a touch screen that supports simultaneous touches may assign unique IDs to each finger.</para>
</remarks>
</member>
<member name="M:Cryville.Input.InputIdentifier.Equals(System.Object)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputIdentifier.Equals(Cryville.Input.InputIdentifier)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputIdentifier.GetHashCode">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputIdentifier.ToString">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputIdentifier.op_Equality(Cryville.Input.InputIdentifier,Cryville.Input.InputIdentifier)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputIdentifier.op_Inequality(Cryville.Input.InputIdentifier,Cryville.Input.InputIdentifier)">
<inheritdoc />
</member>
<member name="T:Cryville.Input.InputManager">
<summary>
Input manager.
</summary>
</member>
<member name="F:Cryville.Input.InputManager.HandlerRegistries">
<summary>
A set of handler types to be initialized.
</summary>
</member>
<member name="M:Cryville.Input.InputManager.#ctor">
<summary>
Creates an instance of the <see cref="T:Cryville.Input.InputManager" /> class and tries to initialize all the handlers in <see cref="F:Cryville.Input.InputManager.HandlerRegistries" />.
</summary>
</member>
<member name="M:Cryville.Input.InputManager.GetHandlerByTypeName(System.String)">
<summary>
Gets the handler with the specified type name.
</summary>
<param name="typeName">The type name.</param>
<returns>The handler with the specified type name. <see langword="null" /> if not found or not initialized.</returns>
</member>
<member name="M:Cryville.Input.InputManager.EnumerateHandlers(System.Action{Cryville.Input.InputHandler})">
<summary>
Enumerates all initialized handlers and passes each of them into a callback function.
</summary>
<param name="cb">The callback function.</param>
</member>
<member name="T:Cryville.Input.InputSource">
<summary>
Input source.
</summary>
</member>
<member name="P:Cryville.Input.InputSource.Handler">
<summary>
The input handler.
</summary>
</member>
<member name="P:Cryville.Input.InputSource.Type">
<summary>
The type of the input source as an identifier of a component of the input handler.
</summary>
<remarks>
<para>This property is used to distinguish different components of the input handler. For example, each key on the keyboard is assigned a unique type number. Use <see cref="M:Cryville.Input.InputHandler.GetTypeName(System.Int32)" /> to get a friendly name of a specific type.</para>
</remarks>
</member>
<member name="M:Cryville.Input.InputSource.Equals(System.Object)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputSource.Equals(Cryville.Input.InputSource)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputSource.GetHashCode">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputSource.ToString">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputSource.op_Equality(Cryville.Input.InputSource,Cryville.Input.InputSource)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputSource.op_Inequality(Cryville.Input.InputSource,Cryville.Input.InputSource)">
<inheritdoc />
</member>
<member name="T:Cryville.Input.InputFrame">
<summary>
Input frame.
</summary>
</member>
<member name="P:Cryville.Input.InputFrame.Time">
<summary>
The timestamp in seconds.
</summary>
</member>
<member name="P:Cryville.Input.InputFrame.IsNull">
<summary>
Whether the vector is null.
</summary>
<remarks>
<para>An input frame with this property set to <see langword="true" /> marks the end of life of an input ID (see <see cref="P:Cryville.Input.InputIdentifier.Id" />.) This usually occurs when, for example, the button of the device is released.</para>
<para>When this property is set to <see langword="true" />, all the components of the vector is meaningless and should be set to 0.</para>
</remarks>
</member>
<member name="P:Cryville.Input.InputFrame.Vector">
<summary>
The input vector.
</summary>
</member>
<member name="M:Cryville.Input.InputFrame.#ctor(System.Double)">
<summary>
Creates an instance of the <see cref="T:Cryville.Input.InputFrame" /> struct with <see cref="P:Cryville.Input.InputFrame.IsNull" /> set to <see langword="true" />.
</summary>
<param name="time">The timestamp in seconds.</param>
</member>
<member name="M:Cryville.Input.InputFrame.#ctor(System.Double,Cryville.Input.InputVector)">
<summary>
Creates an instance of the <see cref="T:Cryville.Input.InputFrame" /> struct.
</summary>
<param name="time">The timestamp in seconds.</param>
<param name="vector">The input vector.</param>
</member>
<member name="M:Cryville.Input.InputFrame.ToString">
<inheritdoc />
</member>
<member name="T:Cryville.Input.InputVector">
<summary>
Input vector.
</summary>
</member>
<member name="P:Cryville.Input.InputVector.X">
<summary>
The first component of the vector.
</summary>
</member>
<member name="P:Cryville.Input.InputVector.Y">
<summary>
The second component of the vector.
</summary>
</member>
<member name="P:Cryville.Input.InputVector.Z">
<summary>
The third component of the vector.
</summary>
</member>
<member name="P:Cryville.Input.InputVector.W">
<summary>
The fourth component of the vector.
</summary>
</member>
<member name="M:Cryville.Input.InputVector.#ctor(System.Single)">
<summary>
Creates an instance of the <see cref="T:Cryville.Input.InputVector" /> struct of one dimension.
</summary>
<param name="x">The first component of the vector.</param>
</member>
<member name="M:Cryville.Input.InputVector.#ctor(System.Single,System.Single)">
<summary>
Creates an instance of the <see cref="T:Cryville.Input.InputVector" /> struct of two dimensions.
</summary>
<param name="x">The first component of the vector.</param>
<param name="y">The second component of the vector.</param>
</member>
<member name="M:Cryville.Input.InputVector.#ctor(System.Single,System.Single,System.Single)">
<summary>
Creates an instance of the <see cref="T:Cryville.Input.InputVector" /> struct of three dimensions.
</summary>
<param name="x">The first component of the vector.</param>
<param name="y">The second component of the vector.</param>
<param name="z">The third component of the vector.</param>
</member>
<member name="M:Cryville.Input.InputVector.#ctor(System.Single,System.Single,System.Single,System.Single)">
<summary>
Creates an instance of the <see cref="T:Cryville.Input.InputVector" /> struct of four dimensions.
</summary>
<param name="x">The first component of the vector.</param>
<param name="y">The second component of the vector.</param>
<param name="z">The third component of the vector.</param>
<param name="w">The fourth component of the vector.</param>
</member>
<member name="M:Cryville.Input.InputVector.op_Addition(Cryville.Input.InputVector,Cryville.Input.InputVector)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputVector.op_Subtraction(Cryville.Input.InputVector,Cryville.Input.InputVector)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputVector.op_Multiply(System.Single,Cryville.Input.InputVector)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputVector.op_UnaryNegation(Cryville.Input.InputVector)">
<inheritdoc />
</member>
<member name="M:Cryville.Input.InputVector.ToString">
<inheritdoc />
</member>
<member name="T:Cryville.Input.ReferenceCue">
<summary>
Provides cues about the frame of reference.
</summary>
</member>
<member name="P:Cryville.Input.ReferenceCue.PhysicalDimension">
<summary>
The physical dimension.
</summary>
</member>
<member name="P:Cryville.Input.ReferenceCue.RelativeUnit">
<summary>
The additional relative unit.
</summary>
</member>
<member name="P:Cryville.Input.ReferenceCue.Flags">
<summary>
The reference flags.
</summary>
</member>
<member name="P:Cryville.Input.ReferenceCue.Origin">
<summary>
The origin.
</summary>
</member>
<member name="P:Cryville.Input.ReferenceCue.Pivot">
<summary>
The pivot.
</summary>
</member>
<member name="M:Cryville.Input.ReferenceCue.Transform(Cryville.Input.InputFrame)">
<summary>
Transforms a frame into the reference by applying the offset specified by <see cref="P:Cryville.Input.ReferenceCue.Origin" />.
</summary>
<param name="frame">The input frame.</param>
<returns>The transformed input frame.</returns>
</member>
<member name="M:Cryville.Input.ReferenceCue.InverseTransform(Cryville.Input.InputFrame)">
<summary>
Transforms a frame out of the reference by removing the offset specified by <see cref="P:Cryville.Input.ReferenceCue.Origin" />.
</summary>
<param name="frame">The input frame.</param>
<returns>The transformed input frame.</returns>
</member>
<member name="M:Cryville.Input.ReferenceCue.Transform(Cryville.Input.InputFrame,Cryville.Input.InputVector)">
<summary>
Transforms a frame into the reference by applying the offset specified by <see cref="P:Cryville.Input.ReferenceCue.Origin" /> and <see cref="P:Cryville.Input.ReferenceCue.Pivot" />.
</summary>
<param name="frame">The input frame.</param>
<param name="universe">The universe size.</param>
<returns>The transformed input frame.</returns>
</member>
<member name="M:Cryville.Input.ReferenceCue.InverseTransform(Cryville.Input.InputFrame,Cryville.Input.InputVector)">
<summary>
Transforms a frame out of the reference by removing the offset specified by <see cref="P:Cryville.Input.ReferenceCue.Origin" /> and <see cref="P:Cryville.Input.ReferenceCue.Pivot" />.
</summary>
<param name="frame">The input frame.</param>
<param name="universe">The universe size.</param>
<returns>The transformed input frame.</returns>
</member>
<member name="T:Cryville.Input.PhysicalDimension">
<summary>
Physical dimension.
</summary>
</member>
<member name="P:Cryville.Input.PhysicalDimension.Time">
<summary>
The dimensions of time.
</summary>
</member>
<member name="P:Cryville.Input.PhysicalDimension.Length">
<summary>
The dimensions of length.
</summary>
</member>
<member name="P:Cryville.Input.PhysicalDimension.Mass">
<summary>
The dimensions of mass.
</summary>
</member>
<member name="P:Cryville.Input.PhysicalDimension.ElectricCurrent">
<summary>
The dimensions of electric current.
</summary>
</member>
<member name="P:Cryville.Input.PhysicalDimension.ThermodynamicTemperature">
<summary>
The dimensions of thermodynamic temperature.
</summary>
</member>
<member name="P:Cryville.Input.PhysicalDimension.AmountOfSubstance">
<summary>
The dimensions of amount of substance.
</summary>
</member>
<member name="P:Cryville.Input.PhysicalDimension.LuminousIntensity">
<summary>
The dimensions of luminous intensity.
</summary>
</member>
<member name="T:Cryville.Input.RelativeUnit">
<summary>
Relative unit.
</summary>
</member>
<member name="F:Cryville.Input.RelativeUnit.None">
<summary>
None.
</summary>
</member>
<member name="F:Cryville.Input.RelativeUnit.Pixel">
<summary>
Pixel.
</summary>
</member>
<member name="T:Cryville.Input.ReferenceFlag">
<summary>
Reference flag.
</summary>
</member>
<member name="F:Cryville.Input.ReferenceFlag.None">
<summary>
None.
</summary>
</member>
<member name="F:Cryville.Input.ReferenceFlag.FlipX">
<summary>
The X axis is flipped.
</summary>
</member>
<member name="F:Cryville.Input.ReferenceFlag.FlipY">
<summary>
The Y axis is flipped.
</summary>
</member>
<member name="F:Cryville.Input.ReferenceFlag.FlipZ">
<summary>
The Z axis is flipped.
</summary>
</member>
<member name="F:Cryville.Input.ReferenceFlag.FlipW">
<summary>
The W axis is flipped.
</summary>
</member>
<member name="T:Cryville.Input.SimpleInputConsumer">
<summary>
A simple input consumer that receives input frames.
</summary>
</member>
<member name="M:Cryville.Input.SimpleInputConsumer.#ctor(Cryville.Input.InputManager)">
<summary>
Creates an instance of the <see cref="T:Cryville.Input.SimpleInputConsumer" /> class.
</summary>
<param name="manager">The input consumer.</param>
</member>
<member name="M:Cryville.Input.SimpleInputConsumer.Activate">
<summary>
Activates all the input handlers.
</summary>
</member>
<member name="M:Cryville.Input.SimpleInputConsumer.Deactivate">
<summary>
Deactivates all the input handlers.
</summary>
</member>
<member name="M:Cryville.Input.SimpleInputConsumer.OnInput(Cryville.Input.InputIdentifier,Cryville.Input.InputFrame)">
<summary>
Called when a new input frame is received.
</summary>
<param name="identifier">The input identifier.</param>
<param name="frame">The new input frame.</param>
</member>
<member name="M:Cryville.Input.SimpleInputConsumer.EnumerateEvents(System.Action{Cryville.Input.InputEvent})">
<summary>
Enumerates all the input events in the queue, passes each of them into the given callback function, and then flushes the queue.
</summary>
<param name="cb">The callback function.</param>
</member>
<member name="M:Cryville.Input.SimpleInputConsumer.EnumerateActiveIdentifiers(System.Action{Cryville.Input.InputIdentifier,Cryville.Input.InputFrame})">
<summary>
Enumerates all the active identifiers and passes each of them into the given callback function with its current frame.
</summary>
<param name="cb">The callback function.</param>
</member>
</members>
</doc>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 46bef57d10a154a489b726decf5cb994
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: