public BulletController(BulletModel bulletModel, BulletView bulletPrefab, string layer) { BulletModel = bulletModel; BulletView = GameObject.Instantiate <BulletView>(bulletPrefab); BulletView.Initialize(this, layer); }
public BulletController CreateBullet(int index, string Layer) { bulletScriptableObject = bulletList.bullets[index]; bulletModel = new BulletModel(bulletScriptableObject); bulletController = new BulletController(bulletModel, bulletView, Layer); bulletsCreated.Add(bulletController); //Initialize bulletview from health HealthBar.Instance.followBullet(); return(bulletController); }
//Destroy logic. public void bulletDestroy() { BulletModel.DestroyBulletModel(GetBulletModel()); BulletView.DestroyBulletView(this.BulletView); }
public void DestroyBulletModel(BulletModel bulletModel) { bulletModel = null; }