// Update is called once per frame void Update() { nextSpawnTime = Random.Range(spawnMinTime, spawnMaxTime); UpdateScoreText scoreKeeper = GameObject.FindObjectOfType <UpdateScoreText>(); currentScore = scoreKeeper.GetScore(); // 1 ball 1 farbe if (currentScore <= 5) { objectsOnce = 1; objectsDiff = 1; } // 1 ball 2 moegliche farben usw else if (currentScore <= 10) { objectsOnce = 1; objectsDiff = 2; } else if (currentScore <= 15) { objectsOnce = 2; objectsDiff = 2; } else if (currentScore <= 20) { objectsOnce = 3; objectsDiff = 2; } else if (currentScore <= 25) { objectsOnce = 3; objectsDiff = 3; } else { objectsOnce = 5; objectsDiff = 3; } //if (objectsDiff >= objects.Length) objectsDiff = objects.Length - 1; //Debug.Log("Score: " + currentScore); }
private void Start() { updateScoreText = FindObjectOfType <UpdateScoreText>(); updateScoreText.UpdateScore(score); }
private void Start() { score = FindObjectOfType <UpdateScoreText>(); }