summaryrefslogtreecommitdiff
path: root/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/InputModules/BaseInput.cs
blob: 8d22d046f450ba2168f10bd6340f437393573690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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);
        }
    }
}