Esempio n. 1
0
    public void Stop3DAudio(string audioName, string audio_source)
    {
        if (string.IsNullOrEmpty(audioName))
        {
            return;
        }

        string eventName = Util.FixPathString(audioName);

        for (int i = 0; i < _effect3DAudioSourceList.Count; ++i)
        {
            EffectAudioSourceItem item = _effect3DAudioSourceList[i];
            if (item.attachedObj != null && (string.IsNullOrEmpty(audio_source) || item.playingId == audio_source))
            {
                if (eventName == item.audioName)
                {
                    UpdateAudioState(item, PlayState.Stop, item.HaveSwitch());
                }
            }
        }

        for (int i = 0; i < _attachedEffect3DAudioSourceList.Count; ++i)
        {
            EffectAudioSourceItem item = _attachedEffect3DAudioSourceList[i];
            if (item.attachedObj != null && (string.IsNullOrEmpty(audio_source) || item.playingId == audio_source))
            {
                if (eventName == item.audioName)
                {
                    UpdateAudioState(item, PlayState.Stop, item.HaveSwitch());
                }
            }
        }
    }
Esempio n. 2
0
    private void StopStatic3DAudio(string audioName, string audio_source)
    {
        if (string.IsNullOrEmpty(audioName))
        {
            return;
        }

        string eventName = audioName;

        for (int i = 0; i < _static3DAudioSourceList.Count; ++i)
        {
            EffectAudioSourceItem item = _static3DAudioSourceList[i];
            if (item.attachedObj != null && (string.IsNullOrEmpty(audio_source) || item.playingId == audio_source))
            {
                if (eventName == item.audioName)
                {
                    UpdateAudioState(item, PlayState.Pause, item.HaveSwitch());
                    break;
                }
            }
        }
    }