动态进行静态批处理优化
2017-11-22 本文已影响19人
_Arturia
public class Aab : MonoBehaviour {
GameObject[] allObjs;
void Start () {
allObjs = new GameObject[this.transform.childCount];
for (int i = 0; i < transform.childCount; i++) {
//this.transform.GetChild (i).name = "TA" + i;
allObjs[i]=this.transform.GetChild (i).gameObject;
}
StaticBatchingUtility.Combine(allObjs, this.gameObject);
}
}
此脚本挂在父物体上