void LoadConfig() { GameData data = new GameData(); LoadFile(ref data); m_currentScore = data.m_totalScore; m_paddleSpare = data.m_lives; m_levelNumber = data.m_currentLevel; Debug.LogFormat("score {0}, lives {1}, levelNumber {2}", m_score, m_paddleSpare, m_levelNumber); UpdateScore(0); //display score stored in config m_levelEnvironment.SetLevelNumber(m_levelNumber); //update level number }
void Start() { Debug.Log("GameController.Start"); m_levelEnvironment = m_levelEnvironmentGO.GetComponent <LevelEnvironment>(); m_levelEntities = m_levelEntitiesGO.GetComponent <LevelEntities>(); m_levelEnvAnimator = m_levelEnvironmentGO.GetComponent <Animator>(); m_score = m_scoreGO.GetComponent <TextMesh>(); m_paddleNrText = m_paddleNrTextGO.GetComponent <TextMesh>(); m_levelEnvironment.SetLevelNumber(m_levelNumber); LoadConfig(); }