Exemplo n.º 1
0
        public void Shoot()
        {
            BulletShot = GunModel.TryShoot();

            if (BulletShot)
            {
                ShootBullet();
            }
        }
Exemplo n.º 2
0
 public void Start()
 {
     gunModel = new GunModel(
         new BottomlessClip(),
         new AccurateAim(AccurateShotRange),
         new GunPositioning(center, hand, gun, pivot, barrel),
         0.0f,
         stats
         );
     rotateBullet = true;
 }
Exemplo n.º 3
0
        private void Start()
        {
            events = GameManager.Instance.Events;

            gunModel = new GunModel(
                new BasicClip(baseGunStats.ClipSize),
                new AccurateAim(accurateShootingRange),
                new GunPositioning(center, hand, gun, pivot, barrel),
                baseGunStats.ReloadRate,
                GunStats
                );

            GunModel.OnReloadBegin += OnReloadBegin;
            GunModel.OnChangeInBulletsLeftInClip += OnChangeInBulletsLeftInClip;
            GunModel.OnChangeInClipSize          += OnChangeInClipSize;

            // Triggers updates in the HUD
            GunModel.ChangeClipSize(baseGunStats.ClipSize);
        }
Exemplo n.º 4
0
 private void Update()
 {
     GunModel.Update(Time.deltaTime);
 }
Exemplo n.º 5
0
 public virtual void AimAt(Vector2 target)
 {
     GunModel.AimAt(target);
     UpdateGunRenderer();
 }