예제 #1
0
        private void SetResetMuffler(Data data, Transform playerTranform, IWeapon weapon)
        {
            if (!isMuffler)
            {
                isMuffler = !isMuffler;

                var muffler = new Muffler(data.Weapon.OneShotMufflerAudioClip, playerTranform, data.Weapon.MufflerPrefab, data.Weapon.ShotVolumeMuffler);
                _modificationWeapon = new ModificationMuffler(data.Weapon, muffler, playerTranform);
                _modificationWeapon.ApplyModification(weapon);
            }

            else if (isMuffler)
            {
                isMuffler = !isMuffler;
                _modificationWeapon.CancelModification(weapon);
            }
        }
예제 #2
0
 private void PickUpAndDropLaserAim(DataWeapon dataWeapon, IWeapon weapon, Material material)
 {
     //В идеале этот метод подписать на событие
     if (!IsExistenceLaserAim)
     {
         var aimLaser = new AimLaser(material);
         _modificationWeapon = new ModificationAimLaser(aimLaser, dataWeapon);
         _modificationWeapon.ApplyModification(weapon);
         IsExistenceLaserAim = true;
         IsAim = true;
     }
     else
     {
         _playerLineRenderer.enabled = false;
         _modificationWeapon.CancelModification(weapon);
         IsExistenceLaserAim = false;
     }
 }