CombineMeshes
来源:互联网 发布:乔丹史兰斯基 知乎 编辑:程序博客网 时间:2024/06/15 11:51
CombineMeshes 是个非常有用的方法,对于提高帧率非常有帮助,我们一起来学习下。
附代码:
public GameObject cube;public GameObject cube1;public GameObject cube2;void Start (){cube1.SetActive (false);cube2.SetActive (false);MeshFilter meshFilter = cube.GetComponent<MeshFilter> ();MeshFilter meshFilter1 = cube1.GetComponent<MeshFilter> ();MeshFilter meshFilter2 = cube2.GetComponent<MeshFilter> ();Material[] mats = new Material[]{cube.GetComponent<MeshRenderer> ().sharedMaterial,cube1.GetComponent<MeshRenderer> ().sharedMaterial,cube2.GetComponent<MeshRenderer> ().sharedMaterial,};CombineInstance[] combines = new CombineInstance[3];combines [0].mesh = meshFilter.sharedMesh;combines [0].transform = meshFilter.transform.localToWorldMatrix;combines [1].mesh = meshFilter1.sharedMesh;combines [1].transform = meshFilter1.transform.localToWorldMatrix;combines [2].mesh = meshFilter2.sharedMesh;combines [2].transform = meshFilter2.transform.localToWorldMatrix;Mesh combineMesh = new Mesh ();combineMesh.CombineMeshes (combines,false);cube.GetComponent<MeshFilter> ().mesh = combineMesh;cube.GetComponent<MeshRenderer> ().sharedMaterials = mats;}
0 0
- CombineMeshes
- Mesh.CombineMeshes 合并网格
- Unity3D Mesh小课堂(五)CombineMeshes合并网格
- Unity3D Mesh小课堂(五)CombineMeshes合并网格
- CombineMeshes unity网格合并后位置会变
- c++第四次实验 -利用循环求和
- 百度坐标转高德坐标(也就是火星坐标)
- c++第四次上机报告
- [IOS/翻译]Media Layer
- 【网络安全】复习网络安全相关内容
- CombineMeshes
- 拯救崩溃的系统
- nginx+tomcat负载均衡搭建
- 单例模式(Singleton pattern)
- Swoole框架介绍
- Turtlebot学习指导第三篇_Turtlebot发布odmo信息,发布imu信息,订阅cmd_vel速度信息的源文件
- [IOS/翻译]Cocoa Touch Layer
- [分享]Ubuntu安装配置FTP服务器--pure-ftp
- Android中pendingIntent的深入理解