zoukankan      html  css  js  c++  java
  • 图标跟着摄像机(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
                    }
                }
    
            }
  • 相关阅读:
    解析excel表格为DataSet
    easyui 上传文件代码
    上传文件后台代码
    easyui dialog
    C++ 强制设置文件大小
    std::function与std::bind
    glog 编译报错 ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
    Qt删除目录
    C++11 中的std::function和std::bind
    TortoiseGit 使用教程
  • 原文地址:https://www.cnblogs.com/Study088/p/9243866.html
Copyright © 2011-2022 走看看