Ejemplo n.º 1
0
 public void Shoot()
 {
     if (model.lastShot + model.fireInterval < Time.timeSinceLevelLoad)
     {
         model.lastShot = Time.timeSinceLevelLoad;
         ControllerBullet controllerBullet = ServiceBullet.Instance.MakeBullet(model.bulletType);
         controllerBullet.SetShooter(this);
         controllerBullet.Shoot(view.muzzle.transform);
     }
 }
Ejemplo n.º 2
0
    public ControllerBullet MakeBullet(BulletTypes bulletType)
    {
        ControllerBullet temp = null;

        switch (bulletType)
        {
        case BulletTypes.defaultBullet: temp = new ControllerDefaultBullet();
            bulletList.Add(temp);
            break;

        case BulletTypes.fastBullet: temp = new ControllerFastBullet();
            bulletList.Add(temp);
            break;

        case BulletTypes.explossiveBullet: temp = new ControllerExplossiveBullet();
            bulletList.Add(temp);
            break;
        }
        temp.OnBulletDestroy += RemoveBullet;
        // Debug.Log(bulletList.Count);
        return(temp);
    }
Ejemplo n.º 3
0
 public void RemoveBullet(ControllerBullet temp)
 {
     //Debug.Log(bulletList.Count);
     // bulletList.Remove(temp);
     bulletList.Remove(temp);
 }