void SetLaps(int laps) { for (int i = 0; i < laps; i++) { TimeDisplayItem newItem = timeDisplayItem.getObject(false, finishedLapsParent.transform).GetComponent <TimeDisplayItem>(); finishedLapsParent.UpdateTable(newItem.gameObject); lapTimesText.Add(newItem); } }
public void RegisterObjective(Objective objective) { objective.onUpdateObjective += OnUpdateObjective; // instanciate the Ui element for the new objective GameObject objectiveUIInstance = objective.isOptional ? secondaryObjectivePrefab.getObject(true, objectivePanel.transform) : primaryObjectivePrefab.getObject(true, objectivePanel.transform); if (!objective.isOptional) { objectiveUIInstance.transform.SetSiblingIndex(0); } ObjectiveToast toast = objectiveUIInstance.GetComponent <ObjectiveToast>(); DebugUtility.HandleErrorIfNullGetComponent <ObjectiveToast, ObjectiveHUDManger>(toast, this, objectiveUIInstance.gameObject); // initialize the element and give it the objective description toast.Initialize(objective.title, objective.description, objective.GetUpdatedCounterAmount(), objective.isOptional, objective.delayVisible); m_ObjectivesDictionary.Add(objective, toast); if (showObjectivePanel) { objectivePanel.UpdateTable(toast.gameObject); } }
public override void OnInspectorGUI() { UITable myTarget = (UITable)target; DrawDefaultInspector(); if (GUILayout.Button("Update")) { myTarget.UpdateTable(null); } }
public void CreateNotification(string text) { GameObject notificationInstance = notificationPrefab.getObject(true, notificationPanel.transform); notificationInstance.transform.SetSiblingIndex(0); NotificationToast toast = notificationInstance.GetComponent <NotificationToast>(); toast.Initialize(text); notificationPanel.UpdateTable(notificationInstance); }