public void HideReticle() { if (_Reticle) { _Reticle.GetComponent <MeshRenderer>().enabled = false; } if (_Laser) { _Laser.gameObject.SetActive(false); } }
void Update() { var x = g.GetComponent <GvrPointerPhysicsRaycaster>().GetLastRay().ray; //var x = currCam.GetComponentInChildren<GvrPointerPhysicsRaycaster>().GetLastRay().ray; RaycastHit hit; //Debug.Log("Here"); if (Physics.Raycast(x, out hit)) { //Debug.Log("I hit " + hit.point.ToString()); if (hit.point.x >= -90f && hit.point.x <= 90f) { if (hit.point.y >= -145f && hit.point.y <= -115f) { if (hit.point.x <= -10f) { CreateNewGameWhite(); } else if (hit.point.x >= 10f) { JoinNewGameBlack(); } } } } }
/* * Update the position of the teletarget according to where the camera hits the floor. * Fake hides the target if the camera is not currently hitting the floor by moving the position * below the floor. */ void LateUpdate() { Vector3 hitPosition = GetIntersection(); teleTarget.transform.position = hitPosition; reticlePointer.GetComponent <Renderer>().enabled = (hitPosition == fakeHide); }
void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); lostTrackingMaterial = spriteRenderer.material; alphaPropertyId = Shader.PropertyToID("_Alpha"); reticlePointer = GameObject.FindObjectOfType <GvrReticlePointer>(); if (reticlePointer) { Renderer reticleRenderer = reticlePointer.GetComponent <Renderer>(); _reticlePointerVisible = reticleRenderer.enabled; } }
// Use this for initialization void Start() { mTargetTime = DEFALUTCOUNT; if (mGvrReticlePointer == null) { mGvrReticlePointer = GetComponentInParent <GvrReticlePointer>(); } mGvrReticlePointer.OnPointerEnterEvent = GvrReticlePointer_OnPointerEnterEvent; mGvrReticlePointer.OnPointerHoverEvent = GvrReticlePointer_OnPointerHoverEvent; mGvrReticlePointer.OnPointerExitEvent = GvrReticlePointer_OnPointerExitEvent; m_meshRenderer = mGvrReticlePointer.GetComponent <MeshRenderer>(); mSelfRenderer = GetComponent <MeshRenderer>(); rendererComponent = GetComponent <Renderer>(); rendererComponent.sortingOrder = m_meshRenderer.sortingOrder; MaterialComp = rendererComponent.material; CreateReticleVertices(); }
public void fn_action() { v_point.GetComponent <MeshRenderer>().material.color = Color.blue; StartCoroutine(c_actionTime(v_function, v_data)); }
public void Start() { v_point = GameObject.Find("GvrReticlePointer").GetComponent <GvrReticlePointer>(); v_point.GetComponent <MeshRenderer>().material.color = Color.black; }
private void GvrReticleOn() { gvrReticlePointer.GetComponent <MeshRenderer> ().enabled = true; gvrReticlePointer.enabled = true; InputTracking.disablePositionalTracking = true; }