1 using System.Collections;
2 using System.Collections.Generic;
4 using UnityEngine.EventSystems;
10 [RequireComponent(typeof(BaseInputModule))]
19 public static VRInput Instance {
get;
private set; }
21 private Camera eventCamera = null;
25 public AVR_ControllerInputManager.BoolEvent mouseButton0Click => AVR_UIInteractionProvider.currentActive ? AVR_UIInteractionProvider.currentActive.mouseButton0Click : AVR_ControllerInputManager.BoolEvent.ALWAYS_FALSE;
26 public AVR_ControllerInputManager.BoolEvent mouseButton0Down => AVR_UIInteractionProvider.currentActive ? AVR_UIInteractionProvider.currentActive.mouseButton0Down : AVR_ControllerInputManager.BoolEvent.ALWAYS_FALSE;
27 public AVR_ControllerInputManager.BoolEvent mouseButton0Up => AVR_UIInteractionProvider.currentActive ? AVR_UIInteractionProvider.currentActive.mouseButton0Up : AVR_ControllerInputManager.BoolEvent.ALWAYS_FALSE;
28 public AVR_ControllerInputManager.BoolEvent mouseButton1Click => AVR_UIInteractionProvider.currentActive ? AVR_UIInteractionProvider.currentActive.mouseButton1Click : AVR_ControllerInputManager.BoolEvent.ALWAYS_FALSE;
29 public AVR_ControllerInputManager.BoolEvent mouseButton1Down => AVR_UIInteractionProvider.currentActive ? AVR_UIInteractionProvider.currentActive.mouseButton1Down : AVR_ControllerInputManager.BoolEvent.ALWAYS_FALSE;
30 public AVR_ControllerInputManager.BoolEvent mouseButton1Up => AVR_UIInteractionProvider.currentActive ? AVR_UIInteractionProvider.currentActive.mouseButton1Up : AVR_ControllerInputManager.BoolEvent.ALWAYS_FALSE;
37 this.eventCamera = eventCamera;
39 c.canvas.worldCamera = eventCamera;
45 if (Instance != null) GameObject.Destroy(Instance);
48 DontDestroyOnLoad(
this);
50 GetComponent<BaseInputModule>().inputOverride =
this;
53 public override bool mousePresent {
get {
return inputManager!=null; } }
58 inputManager && inputManager.getEventStatus(mouseButton1Click)
60 inputManager && inputManager.getEventStatus(mouseButton0Click)
67 inputManager && inputManager.getEventStatus(mouseButton1Down)
69 inputManager && inputManager.getEventStatus(mouseButton0Down)
76 inputManager && inputManager.getEventStatus(mouseButton1Up)
78 inputManager && inputManager.getEventStatus(mouseButton0Up)
82 public override Vector2 mousePosition
86 if(!eventCamera)
return new Vector2(0,0);
87 return new Vector2(eventCamera.pixelWidth/2, eventCamera.pixelHeight/2);
static List< AVR_Canvas > all_canvases
A list of all AVR_Canvases that have at some point been active and not destroyed since ...
Represents a canvas for VR interaction purposes. Allows for interaction with the AVR_UIInteractionPro...