// Use this for initialization void Start() { score = 0; currentTimeBallPoints = timeBallPoints; styleNormal.fontSize = 30; styleNormal.normal.textColor = Color.yellow; styleNormal.hover.textColor = Color.yellow; styleNormal.alignment = TextAnchor.MiddleLeft; styleNormal.margin = new RectOffset(0, 0, 0, 2); styleMiddle.fontSize = 70; styleMiddle.normal.textColor = Color.red; styleMiddle.hover.textColor = Color.red; styleMiddle.alignment = TextAnchor.MiddleRight; styleOwnScore.fontSize = 30; styleOwnScore.alignment = TextAnchor.MiddleLeft; styleOwnScore.margin = new RectOffset(0, 0, 0, 2); styleOwnScore.normal.textColor = Color.green; styleOwnScore.hover.textColor = Color.green; ScoreSaver.Scores newStuff = new ScoreSaver.Scores("You have not a lot scores yet!", -1); ScoreSaver.scorings = ScoreSaver.ListNames(newStuff); //set the properly //ScoreSaver.SetList (); }
void FixedUpdate() { if (Score.gameEnded) { return; } if (fallingObjectCreator.startTimerRunning) { return; } timeToDeath -= Time.deltaTime; minutes = (int)timeToDeath / 60; seconds = (int)timeToDeath % 60; fraction = (int)(timeToDeath * 100) % 60; text = string.Format("{0:0}:{1:00}:{2:00}", minutes, seconds, fraction); if (timeToDeath <= 0 && !showScores) { highScore = score; ScoreSaver.Scores save = new ScoreSaver.Scores(Sys.DateTime.UtcNow.ToString(), score); ScoreSaver.scorings = ScoreSaver.ListNames(save); showScores = true; SoundManager.ToggleMainTheme(false); SoundManager.PlayClipOnce("Victory01", 1f); gameEnded = true; timeOfEnding = Time.timeSinceLevelLoad; } if (Time.timeSinceLevelLoad >= 30 && (currentTimeBallPoints > timeBallPoints - timeBallPointsDecay)) { currentTimeBallPoints -= timeBallPointsDecay; } else if (Time.timeSinceLevelLoad >= 60 && (currentTimeBallPoints > timeBallPoints - (timeBallPointsDecay * 2))) { currentTimeBallPoints -= timeBallPointsDecay; } else if (Time.timeSinceLevelLoad >= 90 && (currentTimeBallPoints > timeBallPoints - (timeBallPointsDecay * 3))) { currentTimeBallPoints -= timeBallPointsDecay; } else if (Time.timeSinceLevelLoad >= 120 && (currentTimeBallPoints > timeBallPoints - timeBallPointsDecay * 3.5)) { currentTimeBallPoints -= timeBallPointsDecay; } else if (Time.timeSinceLevelLoad >= 150 && (currentTimeBallPoints > timeBallPoints - timeBallPointsDecay * 4)) { currentTimeBallPoints -= timeBallPointsDecay; } else if (Time.timeSinceLevelLoad >= 180 && (currentTimeBallPoints > timeBallPoints - timeBallPointsDecay * 4.5)) { currentTimeBallPoints -= timeBallPointsDecay; } }