Example #1
0
 protected override void OnDispose()
 {
     if (null != mNode)
     {
         mNode.Dispose();
         mNode = null;
     }
 }
Example #2
0
 protected override void OnDispose()
 {
     if (null != _executeNode)
     {
         _executeNode.Dispose();
         _executeNode = null;
     }
 }
Example #3
0
        protected override void ProcessMsg(int key, QMsg msg)
        {
            switch (msg.msgId)
            {
            case (int)AudioEvent.SoundSwitch:
                AudioMsgWithBool soundSwitchMsg = msg as AudioMsgWithBool;
                SoundOn = soundSwitchMsg.on;
                break;

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

            case (int)AudioEvent.PlayMusic:
                Debug.LogFormat("play music msg: {0}, is musicOn: ", AudioEvent.PlayMusic.ToString(), MusicOn);
                PlayMusic(msg as AudioMusicMsg);
                break;

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

            case (int)AudioEvent.PlaySound:
                AudioSoundMsg audioSoundMsg = msg as AudioSoundMsg;
                PlaySound(audioSoundMsg);
                break;

            case (int)AudioEvent.PlayVoice:
                PlayVoice(msg as AudioVoiceMsg);
                break;

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

            case (int)AudioEvent.PlayNode:
                IExecuteNode msgPlayNode = (msg as AudioMsgWithNode).Node;
                StartCoroutine(msgPlayNode.Execute());
                break;

            case (int)AudioEvent.AddRetainAudio:
                AddRetainAudioMsg addRetainAudioMsg = msg as AddRetainAudioMsg;
                AddRetainAudio(addRetainAudioMsg.AudioName);
                break;

            case (int)AudioEvent.RemoveRetainAudioAudio:
                RemoveRetainAudioMsg removeRetainAudioMsg = msg as RemoveRetainAudioMsg;
                RemoveRetainAudio(removeRetainAudioMsg.AudioName);
                break;
            }
        }
Example #4
0
 public static void RecordNode(IExecuteNode node)
 {
     if (Instance.mRecording)
     {
         Instance.mReplayTimelineNode.Append(Instance.mStartTime, node);
     }
     else
     {
         Log.E("is not recording when append");
     }
 }
Example #5
0
        public static IEnumerator Execute(this IExecuteNode selfNode)
        {
            if (selfNode.Finished)
            {
                selfNode.Reset();
            }

            while (!selfNode.Execute(Time.deltaTime))
            {
                yield return(null);
            }
        }
 public abstract IExecuteNodeChain Append(IExecuteNode node);
Example #7
0
 public SequenceNode Append(IExecuteNode appendedNode)
 {
     mNodes.Add(appendedNode);
     mExcutingNodes.Add(appendedNode);
     return(this);
 }
Example #8
0
 public override IExecuteNodeChain Append(IExecuteNode node)
 {
     mSequenceNode.Append(node);
     return(this);
 }
Example #9
0
 public TimelinePair(float time, IExecuteNode node)
 {
     Time = time;
     Node = node;
 }
Example #10
0
 public SequenceNode Append(IExecuteNode appendedNode)
 {
     mNodeQueue.Enqueue(appendedNode);
     mExcutingQueue.Enqueue(appendedNode);
     return(this);
 }
Example #11
0
 public RepeatNode(IExecuteNode node, int loopCount)
 {
     LoopCount = loopCount;
     mNode     = node;
 }
Example #12
0
 public void Append(float time, IExecuteNode node)
 {
     TimelineQueue.Enqueue(new TimelinePair(time, node));
 }
Example #13
0
 public RepeatNode(IExecuteNode node, int repeatCount)
 {
     RepeatCount = repeatCount;
     mNode       = node;
 }
Example #14
0
 public SequenceNode Remove(IExecuteNode removedNode)
 {
     mNodes.Remove(removedNode);
     mExcutingNodes.Remove(removedNode);
     return(this);
 }
Example #15
0
 public static T ExecuteNode <T>(this T selBehaviour, IExecuteNode commandNode) where T : MonoBehaviour
 {
     selBehaviour.StartCoroutine(commandNode.Execute());
     return(selBehaviour);
 }
Example #16
0
 public AudioMsgWithNode(IExecuteNode node) : base((int)AudioEvent.PlayNode)
 {
     Node = node;
 }
Example #17
0
 public void Append(float time, IExecuteNode node)
 {
     TimeLinePairList.Add(new TimelinePair(time, node));
 }