示例#1
0
 protected override void OnDispose()
 {
     if (null != mNode)
     {
         mNode.Dispose();
         mNode = null;
     }
 }
示例#2
0
 protected override void OnDispose()
 {
     if (null != _executeNode)
     {
         _executeNode.Dispose();
         _executeNode = null;
     }
 }
示例#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;
            }
        }
示例#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");
     }
 }
示例#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);
示例#7
0
 public SequenceNode Append(IExecuteNode appendedNode)
 {
     mNodes.Add(appendedNode);
     mExcutingNodes.Add(appendedNode);
     return(this);
 }
示例#8
0
 public override IExecuteNodeChain Append(IExecuteNode node)
 {
     mSequenceNode.Append(node);
     return(this);
 }
示例#9
0
 public TimelinePair(float time, IExecuteNode node)
 {
     Time = time;
     Node = node;
 }
示例#10
0
 public SequenceNode Append(IExecuteNode appendedNode)
 {
     mNodeQueue.Enqueue(appendedNode);
     mExcutingQueue.Enqueue(appendedNode);
     return(this);
 }
示例#11
0
 public RepeatNode(IExecuteNode node, int loopCount)
 {
     LoopCount = loopCount;
     mNode     = node;
 }
示例#12
0
 public void Append(float time, IExecuteNode node)
 {
     TimelineQueue.Enqueue(new TimelinePair(time, node));
 }
示例#13
0
 public RepeatNode(IExecuteNode node, int repeatCount)
 {
     RepeatCount = repeatCount;
     mNode       = node;
 }
示例#14
0
 public SequenceNode Remove(IExecuteNode removedNode)
 {
     mNodes.Remove(removedNode);
     mExcutingNodes.Remove(removedNode);
     return(this);
 }
示例#15
0
 public static T ExecuteNode <T>(this T selBehaviour, IExecuteNode commandNode) where T : MonoBehaviour
 {
     selBehaviour.StartCoroutine(commandNode.Execute());
     return(selBehaviour);
 }
示例#16
0
 public AudioMsgWithNode(IExecuteNode node) : base((int)AudioEvent.PlayNode)
 {
     Node = node;
 }
示例#17
0
 public void Append(float time, IExecuteNode node)
 {
     TimeLinePairList.Add(new TimelinePair(time, node));
 }