void Awake() { sceneBuildIndex = SceneManager.GetActiveScene().buildIndex; anim = GetComponent <Animator>(); // timeRecord = LevelscoreManager.recordTimeArray[SceneManager.GetActiveScene().buildIndex]; allRecordTime = LevelscoreManager.LoadRecordTime(); //HERE IS FILESTREAM allRecordStar = LevelscoreManager.LoadRecordStar(); //HERE IS FILESTREAM recordScore = LevelscoreManager.LoadRecordScore(); timeRecord = allRecordTime[sceneBuildIndex]; levelFinishText.text = LevelFinishTextManager.RandLevelFailedText(); }
public void LevelFinished() { am.PlayLevelPassed(); levelPassed = true; float timeCurrent; timeCurrent = Time.timeSinceLevelLoad; if (timeRecord == 0 || timeRecord > timeCurrent) { timeRecord = timeCurrent; levelFinishString = LevelFinishTextManager.RandLevelPassedText(); allRecordStar[sceneBuildIndex] = stars; allRecordTime[sceneBuildIndex] = timeRecord; LevelscoreManager.SavePlayer(allRecordStar, allRecordTime, recordScore); } timeTakenText.text = timeCurrent + " sec"; timeRecordText.text = timeRecord + " sec"; Admanager.CheckForAd(); }