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编程绘制正方形
最新推荐文章于 2022-11-29 11:22:54 发布