//Handle the Click event private void HandleClick() { Debug.Log("Show click state"); if (!notiCanvasHandler.isClicked) { CameraHandler camHandlerScript = m_Camera.GetComponent <CameraHandler>(); camHandlerScript.AnimationFalse(); notiCanvasHandler.SetPanelInfoActive(true); notiCanvasHandler.SetFirstInfoImage(currentIndex); } // m_Renderer.material = m_ClickedMaterial; // if (canvas.gameObject.activeSelf && isClicked) { // Debug.Log ("Bleh"); // canvas.gameObject.SetActive (false); // } else if(!isClicked) { // canvas.gameObject.SetActive (true); // float distX = m_Camera.position.x - this.transform.position.x; // //float distY = m_Camera.position.y - this.transform.position.y; // float distZ = m_Camera.position.z - this.transform.position.z; // // CameraHandler camHandlerScript = m_Camera.GetComponent<CameraHandler>(); // camHandlerScript.AnimationFalse (); // //canvas.gameObject.transform.position = new Vector3(m_Camera.position.x + distX/2+2, m_Camera.position.y, m_Camera.position.z + distZ/2+2); // } }
//Update is called once per frame void Update() { if (!animator.enabled) { //key or mouse click detected if (Input.anyKey || Input.anyKeyDown) { // treeSelectScript.CloseCanvas (); Debug.Log("CLicked or Keydown"); //GameObject.Find("InfoCanvas").SetActive(false); if (notiCanvasHandler.isFirstInfo) { notiCanvasHandler.SetSecondInfoImage(); } else { animator.enabled = true; notiCanvasHandler.SetPanelInfoActive(false); } } } }