var aMaterial:Material; private var mLine:LineRenderer; function Start () { mLine = this.gameObject.AddComponent(LineRenderer); mLine.SetWidth(5, 5); mLine.SetVertexCount(300); mLine.SetColors (Color.yellow,Color.yellow); mLine.material = aMaterial;//材质 mLine.material.color = Color (0, 1, 0, 0.25); mLine.renderer.enabled = true; //启用 } var i:int=0; function Update() { if(i<300) { mLine.SetPosition(i,Input.mousePosition);//鼠标坐标 } i++; } |
Unity 3d 后代生成LineRenderer线
最新推荐文章于 2025-03-13 19:14:14 发布