void ShowPreview() { previewing = true; GOPreview = new GameObject(); foreach (CameraPoint CP in CamPoints) { GameObject NewSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); NewSphere.transform.position = CP.pos; NewSphere.transform.rotation = CP.rot; NewSphere.transform.localScale = NewSphere.transform.localScale / 2; NewSphere.transform.SetParent(GOPreview.transform); } //Smooth Curve SetSmoothCamPoints(); LineRenderer LR; if (gameObject.GetComponent <LineRenderer>()) { LR = gameObject.GetComponent <LineRenderer>(); } else { LR = GOPreview.AddComponent <LineRenderer>(); LR.SetWidth(.2f, .2f); LR.useWorldSpace = true; LR.material = AssetManager.Instance.dataViewMaterial; } LR.SetVertexCount(SmoothCamPoints.Count); for (int i = 0; i < SmoothCamPoints.Count; i++) { LR.SetPosition(i, SmoothCamPoints[i].pos); } }