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