public override void UpdateMesh(List <TreeMaterial> materials, List <TreeVertex> verts, List <TreeTriangle> tris, List <TreeAOSphere> aoSpheres, int buildFlags, float adaptiveQuality, float aoDensity)
{
if (this.geometryMode == 4)
{
if (this.instanceMesh != null)
{
TreeGroupLeaf.cloneMeshFilter = this.instanceMesh.GetComponent <MeshFilter>();
if (TreeGroupLeaf.cloneMeshFilter != null)
{
TreeGroupLeaf.cloneMesh = TreeGroupLeaf.cloneMeshFilter.sharedMesh;
if (TreeGroupLeaf.cloneMesh != null)
{
Vector3 extents = TreeGroupLeaf.cloneMesh.bounds.extents;
float num = Mathf.Max(extents.x, extents.z) * 0.5f;
TreeGroupLeaf.cloneVerts = TreeGroupLeaf.cloneMesh.vertices;
TreeGroupLeaf.cloneNormals = TreeGroupLeaf.cloneMesh.normals;
TreeGroupLeaf.cloneUVs = TreeGroupLeaf.cloneMesh.uv;
TreeGroupLeaf.cloneTangents = TreeGroupLeaf.cloneMesh.tangents;
for (int i = 0; i < TreeGroupLeaf.cloneVerts.Length; i++)
{
Vector3[] expr_D8_cp_0 = TreeGroupLeaf.cloneVerts;
int expr_D8_cp_1 = i;
expr_D8_cp_0[expr_D8_cp_1].x = expr_D8_cp_0[expr_D8_cp_1].x / num;
Vector3[] expr_F0_cp_0 = TreeGroupLeaf.cloneVerts;
int expr_F0_cp_1 = i;
expr_F0_cp_0[expr_F0_cp_1].y = expr_F0_cp_0[expr_F0_cp_1].y / num;
Vector3[] expr_108_cp_0 = TreeGroupLeaf.cloneVerts;
int expr_108_cp_1 = i;
expr_108_cp_0[expr_108_cp_1].z = expr_108_cp_0[expr_108_cp_1].z / num;
}
}
}
if (this.instanceMesh.GetComponent <Renderer>() != null)
{
Material[] sharedMaterials = this.instanceMesh.GetComponent <Renderer>().sharedMaterials;
for (int j = 0; j < sharedMaterials.Length; j++)
{
TreeGroup.GetMaterialIndex(sharedMaterials[j], materials, false);
}
}
}
}
else
{
TreeGroup.GetMaterialIndex(this.materialLeaf, materials, false);
}
for (int k = 0; k < this.nodes.Count; k++)
{
this.UpdateNodeMesh(this.nodes[k], materials, verts, tris, aoSpheres, buildFlags, adaptiveQuality, aoDensity);
}
TreeGroupLeaf.cloneMesh = null;
TreeGroupLeaf.cloneMeshFilter = null;
TreeGroupLeaf.cloneVerts = null;
TreeGroupLeaf.cloneNormals = null;
TreeGroupLeaf.cloneUVs = null;
TreeGroupLeaf.cloneTangents = null;
base.UpdateMesh(materials, verts, tris, aoSpheres, buildFlags, adaptiveQuality, aoDensity);
}