예제 #1
0
    //-----------------------------------------------------------------------------------------------------
    // Load puzzle (Assembled pieces)
    public void Load()
    {
        if (!puzzle)
        {
            return;
        }
        else
        {
            puzzle.LoadProgress(puzzle.name);
        }


        if (PlayerPrefs.HasKey(puzzle.name + "_hints"))
        {
            remainingHints = PlayerPrefs.GetInt(puzzle.name + "_hints");
            if (hintCounterUI)
            {
                hintCounterUI.text = remainingHints.ToString();
            }
        }
        else
        {
            Debug.Log("No saved data found for: " + puzzle.name + "_hints");
            remainingHints = hintLimit;
        }


        if (PlayerPrefs.HasKey(puzzle.name + "_timer"))
        {
            remainingTime = PlayerPrefs.GetFloat(puzzle.name + "_timer");
        }
        else
        {
            Debug.Log("No saved data found for: " + puzzle.name + "_timer");
            remainingTime = timer;
        }
    }