コード例 #1
0
 public void ShowScore()
 {
     for (int i = 0; i < ScoreInfo.scoreList.Count; i++)
     {
         transform.Find("List").GetChild(i).gameObject.SetActive(true);
         transform.Find("List").GetChild(i).transform.Find("question").GetComponent <Text>().text = ScoreInfo.scoreList[i].info;
         transform.Find("List").GetChild(i).transform.Find("score").GetComponent <Text>().text    = ScoreInfo.scoreList[i].wrong.ToString();
         score += ScoreInfo.scoreList[i].score;
     }
     score = ScoreSave.AddScore(SceneManager.GetActiveScene().name, score);
     transform.Find("score").GetComponent <Text>().text = score.ToString();
 }
コード例 #2
0
ファイル: DeathZone.cs プロジェクト: MascartKL/Arkanoid
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.name == "Ball")
     {
         Destroy(collision.gameObject);
         Lose.SetActive(true);
         Time.timeScale = 0;
         ScoreSave.InfSaveScore();
         gameObject.GetComponent <AudioSource>().PlayOneShot(soundLose);
     }
     if (collision.gameObject.tag == "BonusDamage" || collision.gameObject.tag == "BonusLenght" || collision.gameObject.tag == "BonusScore")
     {
         Destroy(collision.gameObject);
     }
 }
コード例 #3
0
ファイル: SaveLoadJson.cs プロジェクト: srs09524/test
    public static void LoadData()
    {
        ScoreSave scoreSave = JsonUtility.FromJson <ScoreSave>(File.ReadAllText(jsonSavePath));


        score = scoreSave.serializedScore;
        date  = scoreSave.serializedDateTime;

        //Debug.Log((TimeSpan)(DateTime.UtcNow - DateTime.Parse(lemonSave.serializedDateTime)));

        //for testing
        Debug.Log("Score saved at: " + Score.ScoreCount);

        ScoreSave.loaded = true;
    }
コード例 #4
0
    public void isEndGame()
    {
        if (sceneindex == 6)
        {
            Invoke("LoadMainMenu", 1f);
        }
        else
        {
            if (levelComplete < sceneindex)
            {
                PlayerPrefs.SetInt("LevelComplete", sceneindex);
            }

            LevelCompl();

            ScoreSave.SaveScore();

            LevelComplete.SetActive(true);
            Time.timeScale = 0;
        }
    }
コード例 #5
0
ファイル: SaveLoadJson.cs プロジェクト: srs09524/test
    public static void SaveData()
    {
        //reference
        ScoreSave scoreSave = new ScoreSave();

        //lemonade
        scoreSave.serializedScore = Score.ScoreCount;
        ScoreSave.score           = scoreSave.serializedScore;


        //Time
        scoreSave.serializedDateTime = DateTime.UtcNow.ToString("dd MMMM, yyyy");

        Debug.Log("Saving Score @: " + Score.ScoreCount);


        string jsonData = JsonUtility.ToJson(scoreSave, true);

        File.WriteAllText(jsonSavePath, jsonData);
        Debug.Log(jsonData);
    }
コード例 #6
0
 //Set score data to panel texts
 public void SetData(ScoreSave score)
 {
     txtName.text  = score.playerName;
     txtScore.text = score.playerScore.ToString();
 }
コード例 #7
0
	// Use this for initialization
	void Start () {
        scoresave = save.GetComponent<ScoreSave>();
	}