using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MoonBehaviour {
public Material mat;
//Use this for initialization
void Start() {
DrawTriangel();
}
void DrawTriangle()
{
gameObject.AddComponent();
Mesh mesh = GetComponent().mesh;
gameObject.AddComponent();
gameObject.GetComponent().material = mat; mesh.vertices=new Vector3[]
{ new Vecotr(0,0,0),new Vector3(0,1,0),new Vector3(1,1,0),new Vector3(1,1,1);
mesh.triangles = new int[](0, 1, 2, 0, 2, 3 };
}
}
};
unity Mesh编程绘制正方形
最新推荐文章于 2023-06-20 18:48:57 发布