public virtual void Shoot(GameObject bullet, Vector3 coords, float destroyTime) { coords = new Vector3(coords.x, coords.y, coords.z - 0.1f); BulletClass bullets = Instantiate(bullet, coords, Quaternion.identity).GetComponent <BulletClass>(); bullets.Initialize(-10f); bullets.gameObject.tag = "EnemyBullet"; Destroy(bullets.gameObject, destroyTime); }
public void Shoot(GameObject bullet, Vector3 coords, float destroyTime, float angle) { coords = new Vector3(coords.x, coords.y, coords.z - 0.1f); BulletClass bullets = Instantiate(bullet, coords, Quaternion.Euler(0, angle, 0)).GetComponent <BulletClass>(); bullets.Initialize(-10f); bullets.gameObject.tag = "BossBullet"; Destroy(bullets.gameObject, destroyTime); }
public void Shoots(GameObject bullet, Vector3 coords, float destroyTime, float angle) { coords = new Vector3(coords.x, coords.y, coords.z - 0.1f); BulletClass bullets = Instantiate(bullet, coords, Quaternion.Euler(0, angle, 0)).GetComponent <BulletClass>(); bullets.Initialize(10f); bullets.gameObject.tag = "Bullet"; bullets.GetComponent <MeshRenderer>().material.color = Color.red; bullets.explosion = explosionObj; Destroy(bullets.gameObject, destroyTime); }