示例#1
0
        protected override void OnDispose()
        {
            base.OnDispose();

            mSequenceNode.Dispose();
            mSequenceNode = null;
        }
示例#2
0
        private void Start()
        {
            this.Sequence()
            .Delay(1.0f)
            .Event(() => Log.I("Sequence1 延时了 1s"))
            .Begin()
            .DisposeWhenFinished()                     // Default is DisposeWhenGameObjDestroyed
            .OnDisposed(() => { Log.I("Sequence1 destroyed"); });

            var sequenceNode2 = SequenceNode.Allocate(DelayNode.Allocate(1.5f));

            sequenceNode2.Append(EventNode.Allocate(() => Log.I("Sequence2 延时 1.5s")));
            sequenceNode2.Append(DelayNode.Allocate(0.5f));
            sequenceNode2.Append(EventNode.Allocate(() => Log.I("Sequence2 延时 2.0s")));

            this.ExecuteNode(sequenceNode2);

            /* 这种方式需要自己手动进行销毁
             * sequenceNode2.Dispose();
             * sequenceNode2 = null;
             */

            // 或者 OnDestroy 触发时进行销毁
            sequenceNode2.AddTo(this);
        }
 public void Append(ProcessNode node)
 {
     if (null == mSequenceNode)
     {
         mSequenceNode = new SequenceNode();
     }
     mSequenceNode.Append(node);
 }
        protected virtual void OnAllExecuteNodeEnd()
        {
            Log.I("#BaseStartProcess: OnAllExecuteNodeEnd");
            mSequenceNode.OnEndedCallback -= OnAllExecuteNodeEnd;
            mSequenceNode.Dispose();
            mSequenceNode = null;

            mOnProcessFinish.InvokeGracefully();
            Actor.RemoveComponent(this);
        }
示例#5
0
        private IEnumerator Start()
        {
//			this.Sequence().Delay();

            var delayNode = new DelayNode(1.0f);

            delayNode.OnBeganCallback = () => Log.I("first began");
            delayNode.OnEndedCallback = () => Log.I("first ended");

            var delayNode2 = new DelayNode(1.0f);

            delayNode2.OnBeganCallback = () => Log.I("second began");
            delayNode2.OnEndedCallback = () => Log.I("second ended");

            yield return(SequenceNode.Allocate(delayNode, delayNode2).Execute());

            yield return(QWait.ForSeconds(1.0f));

            Log.I("from seconds");

            mHostIp = NetworkUtil.GetAddressIP();

            mSocketServer = FlexiSocket.Create(1366, Protocols.BodyLengthPrefix, false);
            mSocketServer.ClientConnected += delegate(ISocketClientToken client)
            {
                Log.I("OnClientConnected ID:{0} Count:{1}", client.ID, mSocketServer.Clients.Count);
            };
            mSocketServer.SentToClient += delegate(bool success, ISocketClientToken client)
            {
                if (success)
                {
                }
            };

            mSocketServer.ReceivedFromClient += delegate(ISocketClientToken client, byte[] message)
            {
                SocketMsg msg = SerializeHelper.FromProtoBuff <SocketMsg>(message);
                mMessage = msg.msgId + ":" + msg.ToEventID;
                if (!string.IsNullOrEmpty(msg.Msg))
                {
                    mMessage += ":" + msg.Msg;
                }
                Log.I("OnReceivedFromClient:{0}", mMessage);
                mMsgQueue.Enqueue(msg);
            };

            mSocketServer.ClientDisconnected += delegate(ISocketClientToken client) {};
            mSocketServer.StartListen(10);

            yield return(0);
        }
        protected override void OnDispose()
        {
            base.OnDispose();

            if (null != mRepeatAction)
            {
                mRepeatAction.Dispose();
            }

            mRepeatAction = null;

            mSequenceNode.Dispose();
            mSequenceNode = null;
        }
        public void Execute()
        {
            if (Acitons != null && Acitons.Count != 0)
            {
                var sequenceNode = new SequenceNode();

                foreach (var actionKitVisualAction in Acitons)
                {
                    sequenceNode.Append(actionKitVisualAction);
                }

                this.ExecuteNode(sequenceNode);
            }
        }
示例#8
0
        private void Start()
        {
            this.Sequence()
            .Delay(1.0f)
            .Event(() => Log.I("Sequence1 延时了 1s"))
            .Begin()
            .OnDisposed(() => { Log.I("Sequence1 destroyed"); });

            var sequenceNode2 = new SequenceNode(DelayAction.Allocate(1.5f));

            sequenceNode2.Append(EventAction.Allocate(() => Log.I("Sequence2 延时 1.5s")));
            sequenceNode2.Append(DelayAction.Allocate(0.5f));
            sequenceNode2.Append(EventAction.Allocate(() => Log.I("Sequence2 延时 2.0s")));

            this.ExecuteNode(sequenceNode2);

            /* 这种方式需要自己手动进行销毁
             * sequenceNode2.Dispose();
             * sequenceNode2 = null;
             */

            // 或者 OnDestroy 触发时进行销毁
            sequenceNode2.AddTo(this);
        }
 private void OnDestroy()
 {
     mSequenceNode3.Dispose();
     mSequenceNode3 = null;
 }
示例#10
0
 public SequenceNodeChain()
 {
     mSequenceNode = new SequenceNode();
 }
示例#11
0
 public RepeatNodeChain(int repeatCount)
 {
     mSequenceNode = new SequenceNode();
     mRepeatAction = new RepeatNode(mSequenceNode, repeatCount);
 }