Esempio n. 1
0
 public static void PlayWeaponSound(this PlayerEntity playerEntity, EWeaponSoundType sound)
 {
     if (playerEntity.hasWeaponSound)
     {
         playerEntity.weaponSound.PlayList.Add(sound);
     }
 }
Esempio n. 2
0
        public SoundConfigItem GetSoundConfig(EWeaponSoundType type)
        {
            switch (type)
            {
            case EWeaponSoundType.LeftFire1:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.Fire));

            case EWeaponSoundType.OnShoulder:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.OnShoulder));

            case EWeaponSoundType.PullBolt:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.PullBolt));

            case EWeaponSoundType.ReloadEnd:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.ReloadEnd));

            case EWeaponSoundType.ReloadStart:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.ReloadStart));

            case EWeaponSoundType.SwitchFireMode:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.SwitchFireMode));

            case EWeaponSoundType.SwitchIn:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.SwitchIn));

            case EWeaponSoundType.ClipDrop:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.ClipDrop));
            }
            return(null);
        }
Esempio n. 3
0
        public void PlaySound(EWeaponSoundType soundType)
        {
            var cfg = GetSoundConfig(soundType);

            if (null == cfg)
            {
                Logger.ErrorFormat("SoundType {0} is null !", soundType);
                return;
            }
            _playerWeapon.PlaySoundOnce(cfg.Id);
        }
        public virtual void PlaySound(EWeaponSoundType sound)
        {
            var cfg = GetSoundConfig(sound);

            if (null == cfg)
            {
                Logger.ErrorFormat("SoundType {0} is null !", sound);
                return;
            }
            var player = _playerWeapon.Owner as PlayerEntity;

            if (null == player)
            {
                Logger.Error("palyer weapon owner is not player entity");
                return;
            }
            _playerWeapon.PlaySoundOnce(cfg.Id);
        }
        public override SoundConfigItem GetSoundConfig(EWeaponSoundType type)
        {
            switch (type)
            {
            case EWeaponSoundType.LeftFire1:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.Left1));

            case EWeaponSoundType.RightFire1:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.Right));

            case EWeaponSoundType.LeftFire2:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.Left2));

            case EWeaponSoundType.Transform:
                return(SingletonManager.Get <SoundConfigManager>().GetSoundById(_config.Transform));
            }
            return(null);
        }
 public abstract SoundConfigItem GetSoundConfig(EWeaponSoundType type);
 public void PlaySound(EWeaponSoundType sound)
 {
 }