public void CommenceShellExplosion(Transform tr) { GameObject shellExpl = PoolService.Instantiate(shellExplosion.gameObject, tr.position, tr.rotation); ParticleSystem ps = shellExpl.GetComponent <ParticleSystem>(); ps.Play(); Destroy(ps.gameObject, 1f); StartCoroutine(GameobjectReturnToPoolDelay(shellExpl, 1f)); }
public void CommenceTankExplosion(Transform t) { GameObject explosionP = PoolService.Instantiate(tankExplosion.gameObject, t.position, t.rotation); ParticleSystem explosionParticles = explosionP.GetComponent <ParticleSystem>(); //ParticleSystem smokeParticles = Instantiate(explosionSmoke, t.position, t.rotation); explosionParticles.Play(); //smokeParticles.Play(); StartCoroutine(GameobjectReturnToPoolDelay(explosionP, 1f)); }
public void SpawnBustedTank(Transform tankPos) { Vector3 pos = new Vector3(tankPos.position.x, 0, tankPos.position.z); GameObject bustedTank = PoolService.Instantiate(BustedTankPrefab, pos, tankPos.rotation); if (bustedTankDelaying) { StartCoroutine(GameobjectDestroyDelay(bustedTank, 2f)); } }
public TankController(TankView tankPrefab, TankModel tankModel, Vector3 _pos, Quaternion _rotation) { TankView = PoolService.Instantiate(tankPrefab.gameObject, _pos, _rotation); //TankView.SetTankDetails(tankModel); }
public TankController(EnemyView enemyPrefab, TankModel tankModel, Vector3 _pos, Quaternion _rotation) { EnemyView = PoolService.Instantiate(enemyPrefab.gameObject, _pos, _rotation); //EnemyView.SetEnemyDetails(tankModel); }