コード例 #1
0
    //locks toggle for rest of day
    public void LockToggle()
    {
        player.isDailyTaskComplete[taskIndex] = true;
        toggle.interactable = false;

        SaveLoadPlayerData.SaveData(player);
    }
コード例 #2
0
    //Saves Player inputed data
    public void PlayerSetup()
    {
        bool isEmpty = false;

        playerName = nameInput.text;
        Debug.Log(playerName);
        for (int i = 0; i < goalInputList.Count; i++)
        {
            if (goalInputList[i].text.Length > 1)
            {
                goals[i] = goalInputList[i].text;
            }
            else
            {
                isEmpty = true;
                // Debug.Log("Woops");
            }
        }

        if (playerName.Length > 1 && isEmpty == false)
        {
            dataHolderScript.player.playerGoals = goals;
            dataHolderScript.player.playerName  = playerName;

            SaveLoadPlayerData.SaveData(dataHolderScript.player);
            gameManager.GetComponent <SceneHandler>().OpenScene("Home");
        }
        else
        {
            //Show Warning Panel
            warningPanel.alpha          = 1f;
            warningPanel.interactable   = true;
            warningPanel.blocksRaycasts = true;
        }
    }
コード例 #3
0
    public void CheckDate()
    {
        if (currentDate.Date == lastLoginDate.Date)
        {
            isSameDay = true;
        }
        else
        {
            isSameDay = false;
        }

        SaveLoadPlayerData.SaveData(dataHolder.player);
    }
コード例 #4
0
    //Set New Name and Goals
    public void SavePlayerChanges()
    {
        playerName = nameInput.text;

        for (int i = 0; i < goalInputList.Count; i++)
        {
            if (goalInputList[i].text.Length > 1)
            {
                goals[i] = goalInputList[i].text;
            }
            else
            {
                containsNull = true;
            }
        }

        if (playerName.Length > 1 && !containsNull)
        {
            dataHolderScript.player.playerName = playerName;
            for (int i = 0; i < goalInputList.Count; i++)
            {
                dataHolderScript.player.playerGoals[i] = goals[i];
            }
            SaveLoadPlayerData.SaveData(dataHolderScript.player);
            optionsPanel.interactable        = true;
            playerSettingsPanel.interactable = false;
            playerSettingsPanel.GetComponent <UIScrollScript>().Scroll();
        }
        else
        {
            //Show Warning Panel
            warningPanel.alpha          = 1f;
            warningPanel.interactable   = true;
            warningPanel.blocksRaycasts = true;
        }
    }
コード例 #5
0
 public void SaveData()
 {
     SaveLoadPlayerData.SaveData(player);
 }
コード例 #6
0
 public void SaveVolume()
 {
     dataHolderScript.player.volume = bgm.volume;
     SaveLoadPlayerData.SaveData(dataHolderScript.player);
 }