protected override void Update() { base.Update(); if (Input.GetMouseButtonDown(0)) { var hit = AbstractMainMenu.Instance.CurrentUIHit(); if (hit) { var gameSaveButton = hit.GetComponentInParent <SaveLoadScreenButton>(); if (gameSaveButton) { if (gameSaveButton != selectedSaveLoadButton) { if (selectedSaveLoadButton) { selectedSaveLoadButton.Deselect(); } selectedSaveLoadButton = gameSaveButton; selectedSaveLoadButton.Select(); } } } } }
public override Coroutine Close(bool withAnimation = true) { if (selectedSaveLoadButton) { selectedSaveLoadButton.Deselect(); selectedSaveLoadButton = null; } return(base.Close(withAnimation)); }
protected void Erase() { if (selectedSaveLoadButton && selectedSaveLoadButton is GameSaveLoadButton gameSaveLoadButton) { SaveSystem.EraseSave(gameSaveLoadButton.filePath); saveLoadButtons.Remove(gameSaveLoadButton); if (gameSaveLoadButton.latest) { var latestSave = saveLoadButtons.FirstOrDefault(); if (latestSave) { latestSave.ApplyLatest(true); } } Destroy(gameSaveLoadButton.gameObject); selectedSaveLoadButton = null; } }