Пример #1
0
    public void DoPlayBGM(ENUM_SOUND_NAME eSound, System.Action CallBackOnFinishBGM = null)
    {
        float fVolume = 0f;

        if (_mapSoundVolume.ContainsKey(eSound))
        {
            fVolume = _mapSoundVolume[eSound] * _fVolumeBGM;
        }
        else
        {
            fVolume = _fVolumeBGM;
        }

        //Debug.Log( eSound + "Volume : " + fVolume );

        if (_pSlotBGM.CheckIsPlaying())
        {
            _pSlotBGM.DoSetFadeOut(DoGetResource_Origin(eSound), fVolume);
        }
        else
        {
            _pSlotBGM.DoPlaySound(DoGetResource_Origin(eSound), fVolume);
        }

        _CallBackOnFinishBGM = CallBackOnFinishBGM;
    }
Пример #2
0
    public void DoPlayBGM(string strSound, System.Action CallBackOnFinishBGM = null)
    {
        float fVolume = 0f;

        if (_mapSoundVolume.ContainsKey(strSound))
        {
            fVolume = _mapSoundVolume[strSound] * _fVolumeBGM;
        }
        else
        {
            fVolume = _fVolumeBGM;
        }

        //Debug.Log( eSound + "Volume : " + fVolume );

        if (_pSlotBGM.CheckIsPlaying())
        {
            _pSlotBGM.DoSetFadeOut(GetAudioClip(strSound), fVolume);
        }
        else
        {
            _pSlotBGM.DoPlaySound(GetAudioClip(strSound), fVolume);
        }

        _CallBackOnFinishBGM = CallBackOnFinishBGM;
    }