private void Init() { mPointsToRender = gameObject.GetComponent <PointMesh>() as PointMesh; mPointList = new PointList(mPointsToRender); mHull = null; mPointList.Clear(); mPointList.ReadPoints(PointsFile); mPointList.Display(true); }
IEnumerator NewHull() { Color c = new Color(Random.value, Random.value, Random.value, 1); GameObject line = new GameObject("line"); yield return(new WaitForEndOfFrame()); mHull = line.AddComponent <Hull>() as Hull; line.transform.SetParent(gameObject.transform, false); yield return(new WaitForEndOfFrame()); yield return(StartCoroutine(mHull.MakeHull(mPointList.Points, c))); yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); mHull.RemoveHullPoints(mPointList.Points); yield return(new WaitForEndOfFrame()); mPointList.Display(true); }