`
810364804
  • 浏览: 784942 次
文章分类
社区版块
存档分类
最新评论

Vectrosity画线插件

 
阅读更多
using UnityEngine;
using System.Collections;
using Vectrosity;

public class TestLine : MonoBehaviour
{ 
    public Material lineMaterial;
    private VectorLine line;
    private Vector2 [] points;

    // Use this for initialization
    void Start()
    {
        points = new Vector2[]{new Vector2(100,100),new Vector2(200,200)};
        line = new VectorLine("Line", points, lineMaterial, 3f, LineType.Discrete, Joins.Weld);
    }

    // Update is called once per frame
    void Update()
    {
        points[1] = new Vector2(Input.mousePosition.x,Input.mousePosition.y);
        line.Draw();
    }
}


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics