void Start() { points = new Vector3[2]; //set the start point of the linerenderer to the position of the gameObject. points[0] = Vector3.zero; //set the end point 20 units away from the GO on the Z axis (pointing forward) points[1] = transform.position + new Vector3(0, 0, 20); //finally set the positions array on the LineRenderer to our new values lineRenderer.SetPositions(points); lineRenderer.enabled = true; lineRenderer.material = new Material(Shader.Find("Sprites/Default")); control = GetComponent <MineSweeperControl>(); }
void Start() { control = GetComponent <MineSweeperControl>(); }