コード例 #1
0
    //public void SetDash()
    //{
    //  timeText.text = "-";
    //}

    private void TaskOnClick()
    {
        if (PlayerPrefsController.GetLives() <= 0)
        {
            Time.timeScale = 1f;
            PlayerPrefsController.SetLives(3);
            SceneManager.LoadScene(levelScene.name);
        }
        else
        {
            SceneManager.LoadScene(levelScene.name);
        }
    }
コード例 #2
0
    public void DeacreaseLives()
    {
        PlayerPrefsController.SetLives(PlayerPrefsController.GetLives() - 1);

        if (PlayerPrefsController.GetLives() <= 0)
        {
            levelController.HandleLooseCondition();
        }
        else
        {
            sceneLoader.Invoke("Respawn", levelLoadDelay);
        }
    }
コード例 #3
0
    public void Play()
    {
        Time.timeScale = 1f;
        if (string.IsNullOrEmpty(PlayerPrefs.GetString("SavedLevel")) == true)
        {
            print("Level set");
            PlayerPrefs.SetString("SavedLevel", "Level 1");
        }

        if (PlayerPrefsController.GetLives() <= 0)
        {
            PlayFromBegining();
        }
        else
        {
            SceneManager.LoadScene(PlayerPrefs.GetString("SavedLevel"));
        }
    }
コード例 #4
0
 private void Update()
 {
     // Update Lives Text
     livesText.text = PlayerPrefsController.GetLives().ToString();
 }