Ejemplo n.º 1
0
        private bool HaveNullPrefabs()
        {
            bool isNull = ReferenceUtil.TestNullReferences(AirplanePrefab, "Airplane Prefab", "PrefabReferencesAuthoringComponent");

            isNull |= ReferenceUtil.TestNullReferences(BulletPrefab, "Bullet Prefab", "PrefabReferencesAuthoringComponent");
            return(isNull);
        }
        private void InitializeAudioSourceArray(out AudioSource[] array, AudioSource prefab, int amount, string referenceName)
        {
            if (ReferenceUtil.TestNullReferences(prefab, referenceName, "SoundController"))
            {
                array = new AudioSource[0];
                return;
            }

            Transform localTransform = transform;

            array = new AudioSource[amount];
            for (int i = 0; i < amount; i++)
            {
                AudioSource source = Instantiate(prefab, localTransform);
                source.enabled = false;
                array[i]       = source;
            }
        }
Ejemplo n.º 3
0
 private void Awake()
 {
     ReferenceUtil.TestNullReferences(_timerText, "Text to timer", "UIController");
     ReferenceUtil.TestNullReferences(_scoreText, "Text to score", "UIController");
     ReferenceUtil.TestNullReferences(_highscoreText, "Text to highscore", "UIController");
 }