Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static LineRenderer CreateLine(Vector3[] points, Color color, float width, GameObject source = null)
- {
- if (source == null)
- {
- source = new GameObject("Connection");
- }
- LineRenderer line = source.AddComponent<LineRenderer>();
- line.positionCount = points.Length;
- for (int i=0; i<points.Length; i++)
- {
- line.SetPosition(i, points[i]);
- }
- line.material = Resources.Load<Material>("Models/Materials/LineColor");
- line.startColor = color;
- line.endColor = color;
- line.startWidth = width;
- line.endWidth = width;
- return line;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement