Exemple #1
0
        private void Start()
        {
            this.scoreText = GameObject.Find("Score").GetComponent <Text>();
            this.livesText = GameObject.Find("Lives").GetComponent <Text>();

            this.hint = GameObject.Find("Hint");
            this.ball = GameObject.Find("Ball").GetComponent <Ball>();

            this.gameManager = GameObject.Find("_GameManager").GetComponent <GameManager>();
            Boxes boxes = GameObject.Find("Boxes").GetComponent <Boxes>();

            if (this.gameManager.savedData != null)
            {
                this.Lifes = this.gameManager.savedData.lifes;
                this.Score = this.gameManager.savedData.score;
                boxes.CreateBoardFromSave(gameManager.savedData);
            }
            else
            {
                this.Lifes = 3;
                this.Score = 0;
                boxes.CreateBoard();
            }

            this.gameManager.ClearSavedData();
        }