diff options
Diffstat (limited to 'Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/InputModules/BaseInput.cs')
-rw-r--r-- | Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/InputModules/BaseInput.cs | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/InputModules/BaseInput.cs b/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/InputModules/BaseInput.cs new file mode 100644 index 0000000..8d22d04 --- /dev/null +++ b/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/InputModules/BaseInput.cs @@ -0,0 +1,80 @@ +namespace UnityEngine.EventSystems +{ + + //c 对UnityEngine.Input进行一次简单包装,方便调试 + // 另外如果希望自定义输入,继承这个类,并实现这些属性 + public class BaseInput : UIBehaviour + { + public virtual string compositionString + { + get { return Input.compositionString; } + } + + public virtual IMECompositionMode imeCompositionMode + { + get { return Input.imeCompositionMode; } + set { Input.imeCompositionMode = value; } + } + + public virtual Vector2 compositionCursorPos + { + get { return Input.compositionCursorPos; } + set { Input.compositionCursorPos = value; } + } + + public virtual bool mousePresent + { + get { return Input.mousePresent; } + } + + public virtual bool GetMouseButtonDown(int button) + { + return Input.GetMouseButtonDown(button); + } + + public virtual bool GetMouseButtonUp(int button) + { + return Input.GetMouseButtonUp(button); + } + + public virtual bool GetMouseButton(int button) + { + return Input.GetMouseButton(button); + } + + public virtual Vector2 mousePosition + { + get { return Input.mousePosition; } + } + + public virtual Vector2 mouseScrollDelta + { + get { return Input.mouseScrollDelta; } + } + + public virtual bool touchSupported + { + get { return Input.touchSupported; } + } + + public virtual int touchCount + { + get { return Input.touchCount; } + } + + public virtual Touch GetTouch(int index) + { + return Input.GetTouch(index); + } + + public virtual float GetAxisRaw(string axisName) + { + return Input.GetAxisRaw(axisName); + } + + public virtual bool GetButtonDown(string buttonName) + { + return Input.GetButtonDown(buttonName); + } + } +} |