博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
图标跟着摄像机(Camera)orthographicSize的值改变大小
阅读量:4487 次
发布时间:2019-06-08

本文共 2497 字,大约阅读时间需要 8 分钟。

默认摄像机(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
().localScale = new Vector3(25, 25, 1); //Selectthebox.transform.GetComponent
().localScale = new Vector3(100f+m_bigMapCameraComponent.orthographicSize, 100f+m_bigMapCameraComponent.orthographicSize, 1); } //bigmapPoint.transform.localScale } } }

 

转载于:https://www.cnblogs.com/Study088/p/9243866.html

你可能感兴趣的文章
PAT-A1033 or codeup 2031 To Fill or Not to Fill (贪心)题解
查看>>
实体字符转换,同样变量密码加盐MD5后生成的加密字符串不同解决办法 (原)
查看>>
《Windows核心编程》第十一章——线程池
查看>>
内存优化
查看>>
数据结构:单链表
查看>>
Go socket
查看>>
无法连接asp.net development server
查看>>
BETTER SUPPORT FOR FUNCTIONAL PROGRAMMING IN ANGULAR 2
查看>>
微信小程序tab栏切换
查看>>
windows pm2 开机启动
查看>>
Flask - 特殊装饰器 和 Flask工作结构模式(FBV, CBV)
查看>>
node.js环境搭建以及入门级hello程序
查看>>
LightOJ1282 - Leading and Trailing(快速幂+数学)
查看>>
【mysql】关于checkpoint机制
查看>>
nginx总结
查看>>
如何设定ASH buffer大小
查看>>
改变调用函数的this指针方向
查看>>
【转】mq
查看>>
Java基础知识学习07-抽象类、接口、多态
查看>>
Oracle学习笔记之七(用户管理、角色与权限、导入导出等)
查看>>