private void LateUpdate() { if (!VRUICheckInteractable.IsInteractable()) { Player.instance.transform.position = gameObject.transform.position; } }
static public bool IsInteractable() { GameObject grpCanvas = GameObject.Find("Grp_Canvas"); if (grpCanvas) { VRUICheckInteractable check = grpCanvas.GetComponent <VRUICheckInteractable>() as VRUICheckInteractable; if (check) { return(check.bInteractable()); } } return(true); }
private void calculateMatInCam() { if (VRUICheckInteractable.IsInteractable()) { cameraFollow = GameObject.Find("VRCamera").GetComponent <Camera>() as Camera; } else { cameraFollow = GameObject.Find("Camera").GetComponent <Camera>() as Camera; } Vector3 pos = new Vector3(0.0f, 0.0f, -distance); Quaternion rot = new Quaternion(); rot.eulerAngles = new Vector3(0.0f, 180.0f, 0.0f); matInCam.SetTRS(pos, rot, gameObject.transform.localScale); }
private void Update() { if (ingameGlobalManager.instance.currentPuzzle) { if (ingameGlobalManager.instance.GetSteamVRTeleportPlayerDown()) { teleportPlayer(); } } else { if ((bPlayerWithUI && !VRUICheckInteractable.IsInteractable()) || (!bPlayerWithUI && VRUICheckInteractable.IsInteractable())) { teleportPlayer(); } } }