/// <summary> /// Add a widget to the configuration /// </summary> /// <param name="wid">Preconfigured widget object</param> public void AddWidget(DBWidget wid) { if (widgets == null) { widgets = new List <DBWidget>(); } widgets.Add(wid); toBuild.Widgets = widgets; }
/// <summary> /// Creates the widget objects specified in wid as children of the sceneObj /// This shouldn't do any computationally expensive tasks - save those for the setupwidget coroutine /// </summary> /// <param name="wid">Widget to create</param> /// <param name="sceneObj">Parent of widgets - sceneObj should have an InfluxSetup component</param> private void CreateWidgets(DBWidget wid, GameObject sceneObj) { GameObject newWidget = Instantiate(widgetPrefab); newWidget.transform.parent = sceneObj.transform; newWidget.transform.localPosition = wid.Position; InfluxReader r = newWidget.GetComponent <InfluxReader>(); r.SetDBVals(wid.Measure, wid.Building, wid.Room); widgets.Add(r); }