/// <summary> /// Update the boulder data and displays /// </summary> /// <param name="boulder"></param> public void EditBoulder(Boulder boulder) { StaticBoulderList.Edit(boulder); GameObject boulderObject = boulders[boulder]; boulders.Remove(boulder); boulders.Add(boulder, boulderObject); boulderObject.GetComponent <BoulderEntryDisplay>().Setup(boulder); OldestDisplay.dirtyBoulders = true; }
/// <summary> /// Sort the list of boulders for a difficulty /// </summary> private void SortBoulderEntriesDisplays() { BoulderListHelper sortedBoulders = (BoulderListHelper)StaticBoulderList.GetByDifficulty(difficulty); for (int i = 0; i < sortedBoulders.Count; i++) { boulders.TryGetValue(sortedBoulders[i], out GameObject boulderObject); if (boulderObject == null) { continue; } boulderObject.transform.SetSiblingIndex(i + 1); } }
public void DirtyBoulders() { foreach (Transform transform in oldestList.transform) { Destroy(transform.gameObject); } foreach (Boulder boulder in StaticBoulderList.GetLastDate()) { BoulderEntryDisplay.InstanciateListObject(boulder, oldestList.transform).GetComponent <Button>().interactable = false; } LayoutRebuilder.ForceRebuildLayoutImmediate(oldestList.GetComponent <RectTransform>()); dirtyBoulders = false; }
public List <Boulder> GetBoulders() { return(StaticBoulderList.GetByDifficulty(difficulty)); }