public static void Event(AudioActionType actionType, AudioType audioType) { if (hasInstance && Instance.OnAudioEvent != null) { Instance.OnAudioEvent(actionType, audioType); } }
void handleAudioEvent(AudioActionType actionType, AudioType audioType) { if (AudioUtil.IsMuteAction(actionType)) { handleMuteAction(actionType, audioType); } }
public static void Event(AudioActionType actionType, AudioType audioType) { if (OnAudioEvent != null) { OnAudioEvent(actionType, audioType); } }
void handleMuteAction(AudioActionType actionType, AudioType audioType) { foreach (AudioSource source in channels.Values) { if (fileList.GetAudioType(source.clip) == audioType) { source.mute = AudioUtil.MutedBoolFromAudioAction(actionType); } } }
public AudioActionType getAudioType(int audioId) { AudioActionType audioActionType = AudioActionType.Once; AudioData config = AudioManager.Instance.GetAudioData(audioId); //Debug.Log(config.id); if (config != null) { audioActionType = (AudioActionType)config.Ptype; } return(audioActionType); }
public void PlayOneAudio(int audioId) { AudioActionType ptype = base.getAudioType(audioId); AudioActionBase audioAction = null; Action <int> startCall = delegate(int aid) { OnStartCall(aid, audioAction); }; audioAction = base.NewAudio(ptype, audioId, startCall, OnEndCall); audioAction.Play(); }
public static bool MutedBoolFromAudioAction (AudioActionType actionType) { switch (actionType) { case AudioActionType.Mute: return true; case AudioActionType.Unmute: return false; default: throw new System.Collections.Generic.KeyNotFoundException(); } }
public static bool MutedBoolFromAudioAction(AudioActionType actionType) { switch (actionType) { case AudioActionType.Mute: return(true); case AudioActionType.Unmute: return(false); default: throw new System.Collections.Generic.KeyNotFoundException(); } }
public void PlayOneAudio(int audioId) { AudioActionType ptype = base.getAudioType(audioId); if (ptype == AudioActionType.Loop) { ptype = AudioActionType.Once; } AudioActionBase audioAction = null; audioAction = base.NewAudio(ptype, audioId, OnStartCall, OnEndCall); if (IsCanPlay()) { audioAction.Play(); } EnqueueAudio(audioAction); }
protected AudioActionBase NewAudio(AudioActionType ptype, int audioId, Action <int> startCall, Action <int> endCall) { AudioActionBase action = null; if (ptype == AudioActionType.Once) { action = new AudioOnceAction(this.s_AudioRoot, audioId, startCall, endCall); } else if (ptype == AudioActionType.Loop) { action = new AudioLoopAction(this.s_AudioRoot, audioId, startCall, endCall); } else if (ptype == AudioActionType.Fade) { action = new AudioFadeAction(this.s_AudioRoot, audioId, startCall, endCall); } else if (ptype == AudioActionType.LoopFade) { action = new AudioLoopFadeAction(this.s_AudioRoot, audioId, startCall, endCall); } return(action); }
public override void Play(params int[] audioIds) { int audioId = 0; if (audioIds != null && audioIds.Length > 0) { audioId = audioIds[0]; } AudioActionType ptype = base.getAudioType(audioId); AudioActionBase audioAction = null; audioAction = base.NewAudio(ptype, audioId, OnStartCall, OnEndCall); if (m_NowPlayAudio != null) { this.m_WaitPlayAudio = audioAction; m_NowPlayAudio.Stop(); } else { this.m_NowPlayAudio = audioAction; this.m_NowPlayAudio.Play(); } }
public void PlayAudio(AudioActionType type) { audioSource.clip = playbleAudio[type]; audioSource.Play(); }
public static void Event (AudioActionType actionType, AudioType audioType) { if (OnAudioEvent != null) { OnAudioEvent(actionType, audioType); } }
void HandleEvent (AudioActionType actionType, AudioType audioType) { if (AudioUtil.IsMuteAction(actionType)) { HandleMuteAction (actionType, audioType); } }
void HandleMuteAction (AudioActionType actionType, AudioType audioType) { foreach (AudioSource source in channels.Values) { if (fileList.GetAudioType(source.clip) == audioType) { source.mute = AudioUtil.MutedBoolFromAudioAction(actionType); } } }
public static bool IsMuteAction (AudioActionType actionType) { return actionType == AudioActionType.Mute || actionType == AudioActionType.Unmute; }
public static bool IsMuteAction(AudioActionType actionType) { return(actionType == AudioActionType.Mute || actionType == AudioActionType.Unmute); }