public void CreateExplosionCloud(Vector3 position, float radius, int count, float delay_time = 0) { float start_time = 0; while (count-- > 0) { Vector3 pos = position + RandomPosition(radius); ExplosionBillboard billboard_explosion = Instantiate(m_explosion_billboard1_prefab, pos, m_explosion_billboard1_prefab.transform.rotation) as ExplosionBillboard; ExplosionSphere volumetric_explosion = Instantiate(m_explosion_sphere_prefab, pos, m_explosion_sphere_prefab.transform.rotation) as ExplosionSphere; billboard_explosion.delayTime = start_time; volumetric_explosion.delayTime = start_time; start_time += delay_time; } }
public void CreateExplosionPillar(Vector3 base_pos, float height, int count, float delay_time = 0) { float vertical_step_size = height / count; Vector3 pos = base_pos; float start_time = Time.time; while (count-- > 0) { ExplosionBillboard billboard_explosion = Instantiate(m_explosion_billboard1_prefab, pos, m_explosion_billboard1_prefab.transform.rotation) as ExplosionBillboard; ExplosionSphere volumetric_explosion = Instantiate(m_explosion_sphere_prefab, pos, m_explosion_sphere_prefab.transform.rotation) as ExplosionSphere; billboard_explosion.delayTime = start_time; volumetric_explosion.delayTime = start_time; start_time += delay_time; pos += Vector3.up * vertical_step_size; } }
public void CreateExplosionCloud(Vector3 position, float radius, int count, float delayTime = 0) { float startTime = 0; while (count-- > 0) { Vector3 pos = position + RandomPosition(radius); ExplosionBillboard billboardExplosion = Instantiate(explosionBillboard1Prefab, pos, explosionBillboard1Prefab.transform.rotation) as ExplosionBillboard; ExplosionSphere volumetricExplosion = Instantiate(explosionSpherePrefab, pos, explosionSpherePrefab.transform.rotation) as ExplosionSphere; billboardExplosion.delayTime = startTime; volumetricExplosion.delayTime = startTime; billboardExplosion.transform.parent = this.transform; volumetricExplosion.transform.parent = this.transform; startTime += delayTime; } }
public void CreateExplosionPillar(Vector3 base_pos, float height, int count, float delayTime = 0) { float verticalStepSize = height / count; Vector3 pos = base_pos; float startTime = Time.time; while (count-- > 0) { ExplosionBillboard billboardExplosion = Instantiate(explosionBillboard1Prefab, pos, explosionBillboard1Prefab.transform.rotation) as ExplosionBillboard; ExplosionSphere volumetricExplosion = Instantiate(explosionSpherePrefab, pos, explosionSpherePrefab.transform.rotation) as ExplosionSphere; billboardExplosion.delayTime = startTime; volumetricExplosion.delayTime = startTime; billboardExplosion.transform.parent = this.transform; volumetricExplosion.transform.parent = this.transform; startTime += delayTime; pos += Vector3.up * verticalStepSize; } }