1 using System.Collections;
2 using System.Collections.Generic;
18 PRIMARY2DAXIS_TOUCH_LEFT,
19 PRIMARY2DAXIS_TOUCH_RIGHT,
20 PRIMARY2DAXIS_TOUCH_LEFTORRIGHT,
21 PRIMARY2DAXIS_TOUCH_MIDDLE,
23 PRIMARY2DAXIS_CLICK_LEFT,
24 PRIMARY2DAXIS_CLICK_RIGHT,
25 PRIMARY2DAXIS_CLICK_LEFTORRIGHT,
26 PRIMARY2DAXIS_CLICK_MIDDLE,
27 PRIMARY2DAXIS_CLICKDOWN,
28 PRIMARY2DAXIS_CLICKDOWN_LEFT,
29 PRIMARY2DAXIS_CLICKDOWN_RIGHT,
30 PRIMARY2DAXIS_CLICKDOWN_LEFTORRIGHT,
31 PRIMARY2DAXIS_CLICKDOWN_MIDDLE,
32 TRIGGER_ONTRIGGERDOWN,
67 public bool primary2DAxisTouch {
69 controller.inputDevice.TryGetFeatureValue(CommonUsages.primary2DAxisTouch, out
bool o);
77 public bool primary2DAxisClick {
79 controller.inputDevice.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out
bool o);
87 public bool primary2DAxisClickDown {
89 controller.inputDevice.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out
bool o);
90 return o && !lastAxisClick;
97 public bool primary2DAxisClickUp {
99 controller.inputDevice.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out
bool o);
100 return !o && lastAxisClick;
107 public Vector2 primary2DAxis {
109 controller.inputDevice.TryGetFeatureValue(CommonUsages.primary2DAxis, out Vector2 o);
117 public bool triggerButton {
119 controller.inputDevice.TryGetFeatureValue(CommonUsages.triggerButton, out
bool o);
127 public bool triggerDown
131 controller.inputDevice.TryGetFeatureValue(CommonUsages.triggerButton, out
bool o);
132 return o && !lastTrigger;
139 public bool triggerUp
143 controller.inputDevice.TryGetFeatureValue(CommonUsages.triggerButton, out
bool o);
144 return !o && lastTrigger;
151 public bool menuButton
155 controller.inputDevice.TryGetFeatureValue(CommonUsages.menuButton, out
bool o);
163 public bool menuButtonDown
167 controller.inputDevice.TryGetFeatureValue(CommonUsages.menuButton, out
bool o);
168 return o && ! lastMenuButton;
175 public bool menuButtonUp
179 controller.inputDevice.TryGetFeatureValue(CommonUsages.menuButton, out
bool o);
180 return !o && lastMenuButton;
190 controller.inputDevice.TryGetFeatureValue(CommonUsages.gripButton, out
bool o);
202 controller.inputDevice.TryGetFeatureValue(CommonUsages.gripButton, out
bool o);
203 return o && !lastGrip;
214 controller.inputDevice.TryGetFeatureValue(CommonUsages.gripButton, out
bool o);
215 return !o && lastGrip;
219 private bool lastTrigger =
false;
220 private bool lastMenuButton =
false;
221 private bool lastAxisClick =
false;
222 private bool lastGrip =
false;
226 controller.inputDevice.TryGetFeatureValue(CommonUsages.triggerButton, out lastTrigger);
227 controller.inputDevice.TryGetFeatureValue(CommonUsages.menuButton, out lastMenuButton);
228 controller.inputDevice.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out lastAxisClick);
237 if(!IsOwner)
return false;
241 case BoolEvent.PRIMARY2DAXIS_CLICK : {
return primary2DAxisClick; }
242 case BoolEvent.PRIMARY2DAXIS_CLICK_LEFT: {
return primary2DAxisClick && primary2DAxis.x < -0.5; }
243 case BoolEvent.PRIMARY2DAXIS_CLICK_RIGHT: {
return primary2DAxisClick && primary2DAxis.x > 0.5; }
244 case BoolEvent.PRIMARY2DAXIS_CLICK_LEFTORRIGHT: {
return primary2DAxisClick && Mathf.Abs(primary2DAxis.x) > 0.5; }
245 case BoolEvent.PRIMARY2DAXIS_CLICK_MIDDLE: {
return primary2DAxisClick && Mathf.Abs(primary2DAxis.x) < 0.5; }
246 case BoolEvent.PRIMARY2DAXIS_CLICKDOWN: {
return primary2DAxisClickDown; }
247 case BoolEvent.PRIMARY2DAXIS_CLICKDOWN_LEFT: {
return primary2DAxisClickDown && primary2DAxis.x < -0.5; }
248 case BoolEvent.PRIMARY2DAXIS_CLICKDOWN_RIGHT: {
return primary2DAxisClickDown && primary2DAxis.x > 0.5; }
249 case BoolEvent.PRIMARY2DAXIS_CLICKDOWN_LEFTORRIGHT: {
return primary2DAxisClickDown && Mathf.Abs(primary2DAxis.x) > 0.5; }
250 case BoolEvent.PRIMARY2DAXIS_CLICKDOWN_MIDDLE: {
return primary2DAxisClickDown && Mathf.Abs(primary2DAxis.x) < 0.5; }
251 case BoolEvent.PRIMARY2DAXIS_TOUCH: {
return primary2DAxisTouch; }
252 case BoolEvent.PRIMARY2DAXIS_TOUCH_LEFT: {
return primary2DAxisTouch && primary2DAxis.x < -0.5; }
253 case BoolEvent.PRIMARY2DAXIS_TOUCH_RIGHT: {
return primary2DAxisTouch && primary2DAxis.x > 0.5; }
254 case BoolEvent.PRIMARY2DAXIS_TOUCH_LEFTORRIGHT: {
return primary2DAxisTouch && Mathf.Abs(primary2DAxis.x) > 0.5; }
255 case BoolEvent.PRIMARY2DAXIS_TOUCH_MIDDLE: {
return primary2DAxisTouch && Mathf.Abs(primary2DAxis.x) < 0.5; }
256 case BoolEvent.TRIGGER_TRIGGER: {
return triggerButton; }
257 case BoolEvent.TRIGGER_ONTRIGGERDOWN: {
return triggerDown; }
258 case BoolEvent.TRIGGER_ONTRIGGERUP: {
return triggerUp; }
259 case BoolEvent.MENUBUTTON: {
return menuButton; }
260 case BoolEvent.MENUBUTTON_DOWN: {
return menuButtonDown; }
261 case BoolEvent.MENUBUTTON_UP: {
return menuButtonUp; }
262 case BoolEvent.GRIP_GRIP: {
return grip; }
263 case BoolEvent.GRIP_ONGRIPDOWN: {
return gripDown; }
264 case BoolEvent.GRIP_ONGRIPUP: {
return gripUp; }
265 case BoolEvent.ANY_CANCEL: {
return menuButtonDown || triggerDown || primary2DAxisClick; }
266 case BoolEvent.ALWAYS_TRUE: {
return true; }
267 case BoolEvent.ALWAYS_FALSE: {
return false; }
268 default : { AVR_DevConsole.cwarn(
"getEventStatus does not recoginze value "+type,
this);
break; }
280 case FloatEvent.PRIMARY2DAXIS_X : {
return primary2DAxis.x; }
281 case FloatEvent.PRIMARY2DAXIS_Y: {
return primary2DAxis.y; }
282 default: { AVR_DevConsole.cwarn(
"getEventStatus does not recoginze value " + type,
this);
break; }
294 case Vec2Event.PRIMARY2DAXIS : {
return primary2DAxis; }
295 default: { AVR_DevConsole.cwarn(
"getEventStatus does not recoginze value " + type,
this);
break; }
Sets the documentation html file inside of Packages/com.avr.core/Documentation/html of a given class...
AVR_Component specifically attatched to an AVR_Controller. Needs to have an AVR_Controller on this ga...