Esempio n. 1
0
        protected override void ProcessMsg(int key, QMsg msg)
        {
            switch (msg.msgId)
            {
            case (ushort)AudioEvent.SoundSwitch:
                AudioMsgWithBool soundSwitchMsg = msg as AudioMsgWithBool;
                mSoundOn = soundSwitchMsg.on;
                break;

            case (ushort)AudioEvent.MusicSwitch:
                AudioMsgWithBool musicSwitchMsg = msg as AudioMsgWithBool;
                mMusicOn = musicSwitchMsg.on;
                if (!mMusicOn)
                {
                    StopMusic();
                }
                break;

            case (ushort)AudioEvent.PlayMusic:
                Debug.LogFormat("play music msg: {0}, is musicOn: ", AudioEvent.PlayMusic.ToString(), mMusicOn);
                PlayMusic(msg as AudioMsgPlayMusic);
                break;

            case (ushort)AudioEvent.StopMusic:
                StopMusic();
                break;

            case (ushort)AudioEvent.PlaySound:
                AudioMsgPlaySound audioMsgPlaySound = msg as AudioMsgPlaySound;
                PlaySound(audioMsgPlaySound);
                break;

            case (ushort)AudioEvent.PlayVoice:
                PlayVoice(msg as AudioMsgPlayVoice);
                break;

            case (ushort)AudioEvent.StopVoice:
                StopVoice();
                break;

            case (ushort)AudioEvent.PlayNode:
                ICoroutineCmdNode msgPlayNode = (msg as AudioMsgWithNode).Node;

                StartCoroutine(msgPlayNode.Execute());
                break;
            }
        }
Esempio n. 2
0
 public RepeatNode(ICoroutineCmdNode node, int repeatCount)
 {
     RepeatCount = repeatCount;
     mNode       = node;
 }
Esempio n. 3
0
        public IEnumerator ExecuteNode(ICoroutineCmdNode node)
        {
            yield return(node.Execute());

            mExecutedNodeCount++;
        }
Esempio n. 4
0
 public TimelinePair(float time, ICoroutineCmdNode node)
 {
     this.Time = time;
     this.Node = node;
 }
Esempio n. 5
0
 public TimelinePair(float time, ICoroutineCmdNode node)
 {
     Time = time;
     Node = node;
 }
Esempio n. 6
0
 public AudioMsgWithNode(ushort msgId, ICoroutineCmdNode node) : base(msgId)
 {
     Node = node;
 }