Пример #1
0
    public void SpawnEnergyVoxels()
    {
        EnergyVoxelPool pool = rsc.poolMng.bigEnergyVoxelPool;

        for (int i = 0; i < bb.knockOutEnergyVoxelsSpawned; ++i)
        {
            EnergyVoxelController voxel = pool.GetObject();
            if (voxel != null)
            {
                //voxel.transform.position = pos;
                voxel.transform.position = energyVoxelsSpawnPoints[i % energyVoxelsSpawnPoints.Length].position;
                voxel.transform.rotation = Random.rotation;
            }
        }
    }
Пример #2
0
    public void SpawnVoxelsAndReturnToPool(bool spawnEnergyVoxels = true)
    {
        EnemyExplosionController explosion = rsc.poolMng.enemyExplosionPool.GetObject();
        Vector3 pos = transform.position;

        if (spawnEnergyVoxels)
        {
            if (explosion != null)
            {
                explosion.transform.position = pos;
                explosion.Play(color, explosion2SoundFx);
            }

            EnergyVoxelPool pool = rsc.poolMng.energyVoxelPool;
            for (int i = 0; i < energyVoxelsSpawnedOnDie; ++i)
            {
                EnergyVoxelController voxel = pool.GetObject();
                if (voxel != null)
                {
                    voxel.transform.position = pos;
                    voxel.transform.rotation = Random.rotation;
                }
            }

            rsc.eventMng.TriggerEvent(EventManager.EventType.ENERGY_VOXEL_SPAWNED, EventInfo.emptyInfo);
        }
        else
        {
            if (explosion != null)
            {
                explosion.transform.position = pos;
                explosion.PlayAudioOnly(explosionWrongColorSoundFx);
            }
        }

        SpawnVoxels();
        rsc.poolMng.spiderPool.AddObject(this);
    }
    public void SpawnVoxelsAndReturnToPool(bool spawnEnergyVoxels = true)
    {
        EnemyExplosionController explosion = rsc.poolMng.enemyExplosionPool.GetObject();
        Vector3 pos = transform.position;

        if (spawnEnergyVoxels)
        {
            if (explosion != null)
            {
                explosion.transform.position = pos;
                explosion.Play(color, explosion2SoundFx);
            }

            EnergyVoxelPool pool = rsc.poolMng.energyVoxelPool;
            for (int i = 0; i < energyVoxelsSpawnedOnDie; ++i)
            {
                EnergyVoxelController voxel = pool.GetObject();
                if (voxel != null)
                {
                    voxel.transform.position = pos;
                    voxel.transform.rotation = Random.rotation;
                }
            }
        }
        else
        {
            if (explosion != null)
            {
                explosion.transform.position = pos;
                explosion.PlayAudioOnly(explosionWrongColorSoundFx);
            }
        }

        SpawnVoxels();
        rsc.poolMng.mosquitoPool.AddObject(this);
    }