- StandaloneInput.cs
- PlatformSpecific /
- Scripts /
- CrossPlatformInput /
- Standard Assets /
- Assets /
- project /
1 using System;
2 using UnityEngine;
3
4 namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific
5 {
6 public class StandaloneInput : VirtualInput
7 {
8 public override float GetAxis(string name, bool raw)
9 {
10 return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name);
11 }
12
13
14 public override bool GetButton(string name)
15 {
16 return Input.GetButton(name);
17 }
18
19
20 public override bool GetButtonDown(string name)
21 {
22 return Input.GetButtonDown(name);
23 }
24
25
26 public override bool GetButtonUp(string name)
27 {
28 return Input.GetButtonUp(name);
29 }
30
31
32 public override void SetButtonDown(string name)
33 {
34 throw new Exception(
35 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
36 }
37
38
39 public override void SetButtonUp(string name)
40 {
41 throw new Exception(
42 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
43 }
44
45
46 public override void SetAxisPositive(string name)
47 {
48 throw new Exception(
49 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
50 }
51
52
53 public override void SetAxisNegative(string name)
54 {
55 throw new Exception(
56 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
57 }
58
59
60 public override void SetAxisZero(string name)
61 {
62 throw new Exception(
63 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
64 }
65
66
67 public override void SetAxis(string name, float value)
68 {
69 throw new Exception(
70 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
71 }
72
73
74 public override Vector3 MousePosition()
75 {
76 return Input.mousePosition;
77 }
78 }
79 }
2 using UnityEngine;
3
4 namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific
5 {
6 public class StandaloneInput : VirtualInput
7 {
8 public override float GetAxis(string name, bool raw)
9 {
10 return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name);
11 }
12
13
14 public override bool GetButton(string name)
15 {
16 return Input.GetButton(name);
17 }
18
19
20 public override bool GetButtonDown(string name)
21 {
22 return Input.GetButtonDown(name);
23 }
24
25
26 public override bool GetButtonUp(string name)
27 {
28 return Input.GetButtonUp(name);
29 }
30
31
32 public override void SetButtonDown(string name)
33 {
34 throw new Exception(
35 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
36 }
37
38
39 public override void SetButtonUp(string name)
40 {
41 throw new Exception(
42 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
43 }
44
45
46 public override void SetAxisPositive(string name)
47 {
48 throw new Exception(
49 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
50 }
51
52
53 public override void SetAxisNegative(string name)
54 {
55 throw new Exception(
56 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
57 }
58
59
60 public override void SetAxisZero(string name)
61 {
62 throw new Exception(
63 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
64 }
65
66
67 public override void SetAxis(string name, float value)
68 {
69 throw new Exception(
70 " This is not possible to be called for standalone input. Please check your platform and code where this is called");
71 }
72
73
74 public override Vector3 MousePosition()
75 {
76 return Input.mousePosition;
77 }
78 }
79 }