圖標跟着攝像機(Camera)orthographicSize的值改變大小


默認攝像機(Camera)orthographicSize默認大小為51

   

       #region //滾輪滑動,大地圖放大縮小
        if (Input.GetAxis("Mouse ScrollWheel") < 0) { if (screenView_1Main.myEquipSearch.issearch == false) { if (m_bigMapCameraComponent.orthographicSize <= 46) {  m_bigMapCameraComponent.orthographicSize += 5; //根據這個變化值進行判斷 m_bigMapSphere.transform.localScale = new Vector3(m_bigMapSphere.transform.localScale.x + 0.4f, m_bigMapSphere.transform.localScale.y + 0.4f, m_bigMapSphere.transform.localScale.z + 0.4f); //圖標放大  //根據orthographicSize 變化值進行判斷 if (m_bigMapCameraComponent.orthographicSize <= 41) { _bigmapPoint.transform.localScale = new Vector3(m_bigMapCameraComponent.orthographicSize / 2, m_bigMapCameraComponent.orthographicSize / 2, m_bigMapCameraComponent.orthographicSize / 2); } else if (m_bigMapCameraComponent.orthographicSize == 46) { _bigmapPoint.transform.localScale = new Vector3(21, 21, 21); } else if (m_bigMapCameraComponent.orthographicSize == 51) { _bigmapPoint.transform.localScale = new Vector3(22, 22, 22); } //m_targetScreenPos = m_bigMapCameraComponent.WorldToScreenPoint(screenView_1Main.my_mouseController.target.transform.position);
                    m_targetWorldPos = m_bigMapCameraComponent.ScreenToWorldPoint(m_targetScreenPos); m_bigMapCamera.transform.position -= (m_targetWorldPos - screenView_1Main.my_mouseController.target.transform.position); m_bigMapCamera.transform.localPosition = Vector3.Lerp(m_bigMapCamera.transform.localPosition, Vector3.zero, m_bigMapCameraComponent.orthographicSize / 51.0f); if (Selectthebox != null) { Selectthebox.transform.GetComponent<RectTransform>().localScale = new Vector3(25, 25, 1); //Selectthebox.transform.GetComponent<RectTransform>().localScale = new Vector3(100f+m_bigMapCameraComponent.orthographicSize, 100f+m_bigMapCameraComponent.orthographicSize, 1);
 } //bigmapPoint.transform.localScale
 } } }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM