We had to meet Drawcall problem in Mobile game developing using unity 3D.
You should solve it by 2 combination way.
1. Make shard material.
2. Combine mesh.
I writing down about "Combine mesh"
1. Make next script as CombineChild on Unity3D
2. and Please attach to parent gameobject.
Cheers
You should solve it by 2 combination way.
1. Make shard material.
2. Combine mesh.
I writing down about "Combine mesh"
1. Make next script as CombineChild on Unity3D
using UnityEngine; using System.Collections; [RequireComponent(typeof(MeshFilter))] [RequireComponent(typeof(MeshRenderer))] public class CombineChild : MonoBehaviour { void Start() { Matrix4x4 thisTransform = transform.worldToLocalMatrix; MeshFilter[] meshFilters = GetComponentsInChildren<MeshFilter>(); CombineInstance[] combine = new CombineInstance[meshFilters.Length]; int i = 0; while (i < meshFilters.Length) { combine[i].mesh = meshFilters[i].sharedMesh; combine[i].transform = thisTransform * meshFilters[i].transform.localToWorldMatrix; meshFilters[i].gameObject.SetActive(false); i++; } transform.GetComponent<MeshFilter>().mesh = new Mesh(); transform.GetComponent<MeshFilter>().mesh.CombineMeshes(combine); //, true, true, true); transform.GetComponent<MeshFilter>().mesh.RecalculateNormals(); transform.gameObject.SetActive(true); } }
2. and Please attach to parent gameobject.
Cheers