Пример #1
0
        public void Shoot()
        {
            BulletShot = GunModel.TryShoot();

            if (BulletShot)
            {
                ShootBullet();
            }
        }
Пример #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;
 }
Пример #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);
        }
Пример #4
0
 private void Update()
 {
     GunModel.Update(Time.deltaTime);
 }
Пример #5
0
 public virtual void AimAt(Vector2 target)
 {
     GunModel.AimAt(target);
     UpdateGunRenderer();
 }