private void InteractionManager_InteractionSourcePressed(UnityEngine.XR.WSA.Input.InteractionSourcePressedEventArgs obj) { var color = cube.GetComponent <Renderer>().material.color;//GetColor("_Color"); Debug.Log("didi the thing " + color); if (obj.pressType == UnityEngine.XR.WSA.Input.InteractionSourcePressType.Select) { // GetComponent<Renderer>().material.color = kubus.GetComponent<Renderer>().material.GetColor("_Color"); // OnSelectInteraction(); // change cube color switch (counter) { case 0: cube.GetComponent <Renderer>().material.color = Color.blue; break; case 1: cube.GetComponent <Renderer>().material.color = Color.red; break; default: cube.GetComponent <Renderer>().material.color = Color.yellow; break; } ; counter++; if (counter > 1) { counter = 0; } } }
/// <summary> /// Handles the HoloLens interaction event. /// </summary> /// <param name="obj">The <see cref="UnityEngine.XR.WSA.Input.InteractionSourcePressedEventArgs"/> instance containing the event data.</param> private void InteractionManager_InteractionSourcePressed(UnityEngine.XR.WSA.Input.InteractionSourcePressedEventArgs obj) { if (obj.pressType == UnityEngine.XR.WSA.Input.InteractionSourcePressType.Select) { OnSelectInteraction(); } }
/// <summary> /// Handles the HoloLens interaction event. /// </summary> /// <param name="obj">The <see cref="UnityEngine.XR.WSA.Input.InteractionSourcePressedEventArgs"/> instance containing the event data.</param> private void InteractionManager_InteractionSourcePressed(UnityEngine.XR.WSA.Input.InteractionSourcePressedEventArgs obj) { if ((_isFocus || IsGlobal) && !_isTap) { _isTap = true; OnClick?.Invoke(); } }
void OnSourcePressed(UnityEngine.XR.WSA.Input.InteractionSourcePressedEventArgs state) { var from = Camera.main.transform.position; var to = Camera.main.transform.forward; RaycastHit hit; if (Physics.Raycast(from, to, out hit, 10f)) { if (hit.collider.gameObject.layer == 31) { SpatialMeshModifier.Instance.Fire(hit.point); } } }
void OnSourcePressed(UnityEngine.XR.WSA.Input.InteractionSourcePressedEventArgs state) { var from = Camera.main.transform.position; var to = Camera.main.transform.forward; RaycastHit hit; if (Physics.Raycast(from, to, out hit, 10f)) { if (hit.collider.gameObject.layer == 31) { var pos = hit.point + hit.normal * offset; var rot = Quaternion.LookRotation(hit.normal, Vector3.up); Instantiate(prefab, pos, rot, null); } } }