Exemplo n.º 1
0
    public static void AddPresentToHistory(InventoryTile inventoryElementUsed)
    {
        for (int i = currentPointOfTime + 1; i < gridHistory.Count;)
        {
            gridHistory.RemoveAt(i);
            inventoryHistory.RemoveAt(i);
        }
        inventoryHistory.Add(inventoryElementUsed);
        gridHistory.Add(new List <GridChange>(gridPresent));
        gridPresent.Clear();
        currentPointOfTime = gridHistory.Count - 1;

        bUndo.interactable  = true;
        bRedo.interactable  = false;
        bClear.interactable = true;
        if (PuzzleManager.CheckIfCurrentCanBeSubmitted())
        {
            bSubmit.interactable = true;
            //Debug.Log("PuzzleComplete!");
            puzzleCompletePS.Play();
        }
        else
        {
            bSubmit.interactable = false;
        }
    }