public void SpawnVoxels()
    {
        voxelization.CalculateVoxelsGrid();
        voxelization.SpawnVoxels();

        EnemyExplosionController explosion = rsc.poolMng.enemyExplosionPool.GetObject();

        if (explosion != null)
        {
            explosion.transform.position = transform.position;
            explosion.PlayAll(dieExplosionSoundFx);
        }
    }
    public void Explode()
    {
        EnemyExplosionController explosion = rsc.poolMng.enemyExplosionPool.GetObject();

        if (explosion != null)
        {
            explosion.transform.position = transform.position;
            explosion.PlayAll(finalExplosionSoundFx);
        }

        rsc.rumbleMng.Rumble(0, 0.3f, 0.5f, 0.5f);
        rsc.camerasMng.PlayEffect(0, 0.3f, 0.2f);
        voxelization.SpawnVoxels();
        //Destroy(gameObject);
        gameObject.SetActive(false);
    }
Esempio n. 3
0
 public void SpawnVoxels()
 {
     if (blackboard.lastShotSameColor)
     {
         voxelization.SetMaterial(color);
         voxelization.SpawnFakeVoxels();
     }
     else
     {
         voxelization.SetGreyMaterial();
         //Wrong color does not explode so, grid has to be more precise
         voxelization.CalculateVoxelsGrid();
         voxelization.SpawnColliderThisTime = false;
         voxelization.SpawnVoxels();
     }
 }