Esempio n. 1
0
        void Start()
        {
            SetVolumenGeneral(1);

            DontDestroyOnLoad(this);

            //Getting clip group index for easier use
            clipIndex = new int[groupSizes.Length];
            int counter = 0;

            for (int i = 0; i < groupSizes.Length; i++)
            {
                clipIndex[i] = counter;
                counter     += groupSizes[i];
            }
            //Setting cam if not publicly set
            if (!cam)
            {
                cam = Camera.main;
            }
            //Making sure audio dad is set up correctly
            if (!audioDad.GetComponent <AudioDad>())
            {
                audioDad.AddComponent <AudioDad>();
            }
            //Making pools and prespawning
            PoolManager.MakePool(audioDad);
            PoolManager.SetPoolLimit(audioDad, clips.Length * 50);
            PoolManager.PreSpawn(audioDad, clips.Length * 6, false);
        }
Esempio n. 2
0
 private void Start()
 {
     cooldownMeteor    = Random.Range(timeToSpawnMeteor.x, timeToSpawnMeteor.y);
     cooldownBlackHole = Random.Range(timeToSpawnBlackHole.x, timeToSpawnBlackHole.y);
     PoolManager.MakePool(meteor, 5, 3, true);
 }