protected override void Awake() { base.Awake(); Impl = new GvrPointerInputModuleImpl(); EventExecutor = new GvrEventExecutor(); UpdateImplProperties(); }
protected override void Awake() { UnityEngine.XR.XRSettings.enabled = true; base.Awake(); Impl = new GvrPointerInputModuleImpl(); EventExecutor = new GvrEventExecutor(); UpdateImplProperties(); }
public void Setup() { SubstituteComponent.BeginComponentContext(); // Create input module implementation. module = new GvrPointerInputModuleImpl(); // Create Event System. GameObject eventSystemObj = new GameObject("EventSystem"); eventSytem = eventSystemObj.AddComponent <EventSystem>(); // Create mock pointer. pointer = SubstituteComponent.For <GvrBasePointer>(eventSystemObj); pointer.PointerTransform.Returns(eventSytem.transform); pointer.IsAvailable.Returns(true); module.Pointer = pointer; // Create mock scroll input. scrollInput = new GvrPointerScrollInput(); module.ScrollInput = scrollInput; // Create mock module controller. moduleController = Substitute.For <IGvrInputModuleController>(); moduleController.eventSystem.Returns(eventSytem); resultCache = new List <RaycastResult>(); moduleController.RaycastResultCache.Returns(resultCache); module.ModuleController = moduleController; // Create mock event executor. eventExecutor = Substitute.For <IGvrEventExecutor>(); module.EventExecutor = eventExecutor; // Create dummy objects to use for hit detection. raycastResult = new RaycastResult(); hitObject = new GameObject("HitObject"); hitPos = new Vector3(1.0f, 2.0f, 3.0f); dummyRaycastResult = new RaycastResult(); }