/// <summary> /// Builds a child widget for each label /// </summary> /// <param name="labels">List of all types to build</param> public void BuildChildren(string[] labels) { children = new List <DataWidgetHandler>(); for (int i = 0; i < labels.Length; i++) { //Vector3 position = new Vector3(); GameObject go = Instantiate(GenericDataWidgetObj, currentChild[i].transform); go.transform.localPosition = Vector3.zero; DataWidget toAdd = go.GetComponent <DataWidget>(); DataWidgetHandler toAdd2 = go.GetComponent <DataWidgetHandler>(); toAdd2.SetWidgetObjDistance(Random.Range(4f, 8f)); toAdd.SetLabel(labels[i]); // TODO: remove this toAdd2.graph.sprite = setGraph(labels[i]); reader.AddChild(toAdd); children.Add(toAdd2); toAdd2.EnableWidget(false); } }
private void CloseAction() { handler.EnableWidget(false); }