33 lines
747 B
C#
33 lines
747 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 保存Lod后的mesh
|
|
/// </summary>
|
|
public class LodMeshesData : MonoBehaviour
|
|
{
|
|
#region//私有变量
|
|
[SerializeField]
|
|
private LodMesh[] newMeshes = null;
|
|
#endregion
|
|
|
|
#region//公共函数
|
|
public void Initialization(int lv)
|
|
{
|
|
newMeshes = new LodMesh[lv];
|
|
}
|
|
public void AddData(int curLv, Mesh ms)
|
|
{
|
|
if (newMeshes != null && curLv < newMeshes.Length)
|
|
{
|
|
newMeshes[curLv] = new LodMesh();
|
|
newMeshes[curLv].lodLevel = curLv;
|
|
newMeshes[curLv].mesh = ms;
|
|
newMeshes[curLv].vertexCount = ms.vertexCount;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|