Example #1
0
    /// <summary>
    /// 播放特殊枚举类型音效
    /// 注:必须属于组合表内表明定义的
    /// </summary>
    /// <param name="ComboId">组合Id</param>
    /// <param name="type">类型枚举</param>
    /// <param name="place">主角or其他 --玩家跟主角音效不同,目前只有船有需求</param>
    ///<param name="alreadyPrepare">是否已经执行了预先加载事件 Prepare</param>
    /// <param name="point">播放位置</param>
    public static void PlaySpecialTypeMusicOrSound(int ComboId, WwiseMusicSpecialType type, WwiseMusicPalce place, bool alreadyPrepare, Vector3 point, Action<object> endAction = null, SystemObject userEndData = null)
    {
        if (ComboId <= 0)
            return;

        CfgEternityProxy cfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        SoundComboData?[] soundCombos = cfgEternityProxy.GetSoundComboDataByKey(ComboId);

        int musicId = -1;
        for (int i = 0; i < soundCombos.Length; i++)
        {
            if (soundCombos[i].Value.Type == (int)type && soundCombos[i].Value.Place == (int)place)
            {
                musicId = soundCombos[i].Value.MusicId;
                break;
            }
        }

        if (musicId <= 0)
        {
            Debug.LogWarning(string.Format("检查表SoundCombo 表,数据不对 ComboId = {0}, type = {1}", ComboId, (int)type));
            return;
        }
        PlayMusicOrSound(musicId, alreadyPrepare, point, endAction);
    }
    /// <summary>
    /// 显示设备死亡特效
    /// </summary>
    /// <param name="componentEvent"></param>
    //   private void OnShowDeviceDeadFX(IComponentEvent componentEvent)
    //{
    //	if (m_Presentation.DeathFXAddressList.Count == 0)
    //		return;

    //	EffectController deathFX = EffectManager.GetInstance().CreateEffect(m_Presentation.DeathFXAddressList[0], EffectManager.GetEffectGroupNameInSpace(false));
    //	deathFX.transform.SetParent(m_Property.GetSkinRootTransform(), false);
    //	deathFX.SetCreateForMainPlayer(false);
    //}

    /// <summary>
    /// 战斗状态提示音效.
    /// 提示音的英语不会写-_-
    /// </summary>
    /// <param name="audioID"></param>
    private void PlayBattleStateAudio(WwiseMusicSpecialType SpecialType)
    {
        if (m_Property.IsMain() && !m_Property.IsDead())
        {
            WwiseUtil.PlaySound(WwiseManager.voiceComboID, SpecialType, WwiseMusicPalce.Palce_1st, false, null);
        }
    }
 /// <summary>
 /// 播放音效
 /// </summary>
 /// <param name="sound">音效类型</param>
 private void PlaySound(WwiseMusicSpecialType sound)
 {
     //TaskVoiceInfo msg = new TaskVoiceInfo();
     //msg.audioID = (int)sound;
     //msg.isVoice = true;
     //msg.text = "";
     //msg.isReplaceOther = true;
     //msg.place = WwiseMusicPalce.Palce_1st;
     //Facade.SendNotification(NotificationName.Voice, msg);
     /// 超级电脑语音非语音助手
     WwiseUtil.PlaySound(WwiseManager.voiceComboID, sound, WwiseMusicPalce.Palce_1st, false, null);
 }
Example #4
0
    /// <summary>
    /// 播放特殊枚举标注的音效
    /// </summary>
    /// <param name="ComboId">组合ID</param>
    /// <param name="type">类型</param>
    /// <param name="palce">第几人称</param>
    /// <param name="alreadyPrepare">是否已经 Prepare 加载了 一般给 false</param>
    /// <param name="point">位置</param>
    public static void PlaySound(int ComboId, WwiseMusicSpecialType type, WwiseMusicPalce palce, bool alreadyPrepare, Vector3 point, Action <SystemObject> playEndAction = null, SystemObject userEndData = null)
    {
        MsgPlaySpecialTypeMusicOrSound parame = new MsgPlaySpecialTypeMusicOrSound();

        parame.ComboId        = ComboId;
        parame.type           = type;
        parame.palce          = palce;
        parame.alreadyPrepare = alreadyPrepare;
        parame.point          = point;
        parame.UseSoundParent = false;
        parame.endAction      = playEndAction;
        parame.userEndData    = userEndData;
        GameFacade.Instance.SendNotification(NotificationName.MSG_SOUND_PLAY, parame);
    }
Example #5
0
 private void PlaySystemSound(WwiseMusicSpecialType sound, Action <object> playEndAction = null)
 {
     WwiseUtil.PlaySound(WwiseManager.voiceComboID, sound, WwiseMusicPalce.Palce_1st, false, null, playEndAction);
 }