private void Start() { MonoBehaviour[] monoBehaviours = GetComponents <MonoBehaviour>(); bool found = false; foreach (MonoBehaviour monoBehaviour in monoBehaviours) { if (monoBehaviour.GetType().Name == "Coin") { found = true; } } if (!found) { Debug.Log("ERROR: CoinADDON Component placed on GameObject without Coin Script, OR Coin Script named incorrectly, must be named EXACTLY 'Coin'."); } //Text[] texts = FindObjectsOfType<Text>(); scoreADDON = FindObjectOfType <ScoreADDON>(); scoreText = scoreADDON.GetComponent <Text>(); if (scoreText == null) { Debug.Log("ERROR: GameCanvas is not present in the scene."); } }