コード例 #1
0
 public static void Event(AudioActionType actionType, AudioType audioType)
 {
     if (hasInstance && Instance.OnAudioEvent != null)
     {
         Instance.OnAudioEvent(actionType, audioType);
     }
 }
コード例 #2
0
 void handleAudioEvent(AudioActionType actionType, AudioType audioType)
 {
     if (AudioUtil.IsMuteAction(actionType))
     {
         handleMuteAction(actionType, audioType);
     }
 }
コード例 #3
0
 public static void Event(AudioActionType actionType, AudioType audioType)
 {
     if (OnAudioEvent != null)
     {
         OnAudioEvent(actionType, audioType);
     }
 }
コード例 #4
0
 void handleMuteAction(AudioActionType actionType, AudioType audioType)
 {
     foreach (AudioSource source in channels.Values)
     {
         if (fileList.GetAudioType(source.clip) == audioType)
         {
             source.mute = AudioUtil.MutedBoolFromAudioAction(actionType);
         }
     }
 }
コード例 #5
0
        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);
        }
コード例 #6
0
        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();
        }
コード例 #7
0
	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();

		}
	}
コード例 #8
0
    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();
        }
    }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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();
            }
        }
コード例 #12
0
 public void PlayAudio(AudioActionType type)
 {
     audioSource.clip = playbleAudio[type];
     audioSource.Play();
 }
コード例 #13
0
	public static void Event (AudioActionType actionType, AudioType audioType) {
		if (OnAudioEvent != null) {
			OnAudioEvent(actionType, audioType);
		}
	}
コード例 #14
0
	void HandleEvent (AudioActionType actionType, AudioType audioType) {

		if (AudioUtil.IsMuteAction(actionType)) {

			HandleMuteAction (actionType, audioType);

		}

	}
コード例 #15
0
	void HandleMuteAction (AudioActionType actionType, AudioType audioType) {
		foreach (AudioSource source in channels.Values) {

			if (fileList.GetAudioType(source.clip) == audioType) {

				source.mute = AudioUtil.MutedBoolFromAudioAction(actionType);

			}

		}
	}
コード例 #16
0
	public static bool IsMuteAction (AudioActionType actionType) {
		return actionType == AudioActionType.Mute || actionType == AudioActionType.Unmute;
	}
コード例 #17
0
 public static bool IsMuteAction(AudioActionType actionType)
 {
     return(actionType == AudioActionType.Mute || actionType == AudioActionType.Unmute);
 }