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();
    }
}

Vectrosity画线插件_第1张图片

你可能感兴趣的:(插件,unity3d,画线)