コード例 #1
0
    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();
                    }
                }
            }
        }
    }
コード例 #2
0
    public override Coroutine Close(bool withAnimation = true)
    {
        if (selectedSaveLoadButton)
        {
            selectedSaveLoadButton.Deselect();
            selectedSaveLoadButton = null;
        }

        return(base.Close(withAnimation));
    }
コード例 #3
0
    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;
        }
    }