public void ChangeColor(Color color) { this.color = color; if (actTailPart != null) { LineRenderer lr = actTailPart.GetComponent <LineRenderer>(); lr.startColor = color; lr.endColor = color; } }
private void NewTailPart(Vector3 actPosition) { if (actTailPart != null) { actTailPart.End(actPosition); } actTailPart = Instantiate(tailPartPrefab, transform).GetComponent <TailPart>(); actTailPart.tail = this; LineRenderer lr = actTailPart.GetComponent <LineRenderer>(); lr.startColor = color; lr.endColor = color; actTailPart.SetThickness(size); tailParts.Add(actTailPart); }