// #ATL public Draw_s CreateDraw(float i = 1.0f) { GameObject newGameObject = Instantiate(prefab); Draw_s newDraw = newGameObject.GetComponent <Draw_s>(); newDraw.drawController = this; newDraw.transform.SetParent(this.transform); newDraw.transform.localPosition = Vector3.up * i * .1f; return(newDraw); }
// #ATL public void RemoveDraw(Draw_s draw) { // Note that the array is still the same size. for (int i = 0; i < draws.Length; i++) { if (draws[i] == draw) { draws [i] = null; } } // Observe which now have values vs which are null for (int i = 0; i < draws.Length; i++) { if (debug) { Debug.Log("index " + i + " value is " + draws [i]); } } }