void DrawLine(Vector3 start, Vector3 end, Color color, float duration = 0.2f) { GameObject myLine = new GameObject(); myLine.transform.position = start; myLine.AddComponent<LineRenderer>(); LineRenderer lr = myLine.GetComponent<LineRenderer>(); lr.material = new Material(Shader.Find("Particles/Alpha Blended Premultiply")); lr.startColor = color; lr.endColor = color; lr.startWidth = 0.02f; lr.SetPosition(0, start); lr.SetPosition(1, end); //GameObject.Destroy(myLine, duration); }
Nenhum comentário:
Postar um comentário