private void Start() { PaintPoint lastPoint = FindObjectsOfType <PaintPoint>().Where(x => (get_seq(this) - 1) == get_seq(x)).FirstOrDefault(); if (lastPoint == null) { return; } var line1 = gameObject.AddComponent <LineRenderer>(); line1.material = new Material(Shader.Find("Particles/Additive")); line1.positionCount = 2; line1.startWidth = linewidth; line1.endWidth = linewidth; line1.startColor = get_color(lastPoint); line1.endColor = get_color(this); line1.SetPosition(0, lastPoint.transform.position); lr = line1; HandlePos(transform.position); }
private static Color get_color(PaintPoint tp) { var i = ((PointItem)tp.item); return(new Color(i.R, i.G, i.B, i.A)); }
private static int get_seq(PaintPoint tp) { return(((PointItem)tp.item).seq); }