怎样通过Mesh创建的几何图元怎么改变颜色

宝宝妈妈2023-10-18  84

public class meshTriangles : MonoBehaviour
{
// Use this for initialization
void Start()
{
Mesh mesh = GetComponent<MeshFilter>()mesh;
meshClear();
// make changes to the Mesh by creating arrays which contain the new values
meshvertices = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 1, 0), new Vector3(1, 1, 0) };
meshuv = new Vector2[] { new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 1) };
meshtriangles = new int[] { 0, 1, 2 };
var vertices = meshvertices;
Color[] colors = new Color[3];
for (int i = 0; i < 3; i++)
{
colorsSetValue(new Color(0, 1, 0), i);
}
meshcolors = colors;
}
}

以上就是关于怎样通过Mesh创建的几何图元怎么改变颜色全部的内容,包括:怎样通过Mesh创建的几何图元怎么改变颜色、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

转载请注明原文地址:https://www.54852.com/read/1311925.html

最新回复(0)