Exemple #1
0
    /// <summary>
    /// Deletes the currently selected move from the list of moves
    ///
    public void DeleteMove()
    {
        foreach (SelectionPanelBahviour panel in selectedMovesPanels)
        {
            panel.RemovePanelWithMove(moveToBeDeleted.GetName());
        }

        AvailableMoves.DeleteMove(moveToBeDeleted);
        foreach (MovePanelBehaviour panel in listItems)
        {
            Destroy(panel.gameObject);
        }
        if (selectedListIndex < listItems.Length - 1)
        {
            selectedListIndex = Mathf.Max(selectedListIndex, 0);
        }
        else
        {
            selectedListIndex = Mathf.Max(selectedListIndex - 1, 0);
        }

        InputSettings.Deregister(moveToBeDeleted.GetName());

        hasDeleted     = true;
        controlsActive = true;

        SaveLoad.Save(moves);
        Init();
    }