Пример #1
0
        public void Execute_Should_Not_Execute_Anything_On_Empty_Actions()
        {
            var arguments = new Mock <IActionExecutionArguments>();

            arguments.SetupAllProperties();

            delayAction.Execute(arguments.Object);

            arguments.VerifyGet(x => x.Source, Times.Never);
            arguments.Verify(x => x.GetService <IServiceScopeFactory>(), Times.Never);
        }
Пример #2
0
 private void Update()
 {
     if (mDelay3s != null && !mDelay3s.Finished && mDelay3s.Execute(Time.deltaTime))
     {
         Debug.Log("Delay3s 执行完成");
     }
 }
 private void CloseNotification(INotification notification)
 {
     if (notification != null)
     {
         notification.DisplayPart.OnClose();
         DelayAction.Execute(TimeSpan.FromMilliseconds(300),
                             () => _window?.CloseNotification(notification.DisplayPart),
                             _dispatcher);
     }
 }
Пример #4
0
        private void PlayAudioClip()
        {
            mIsPause = false;
            mSource.Stop();
            mSource.clip = mAudioClip;

            var delayNode = new DelayAction(Mathf.Max(mAudioClip.length, 0.5f))
            {
                OnEndedCallback = OnSoundPlayFinish
            };

            delayCoroutine = AudioManager.Instance.StartCoroutine(delayNode.Execute());

            if (null != mOnStartListener)
            {
                mOnStartListener(this);
            }

            mSource.Play();
        }
Пример #5
0
        protected override void ProcessMsg(int key, PTMsg msg)
        {
            PTDebug.Log("{0}", msg.EventID);
            switch (key)
            {
            case (ushort)UIFilterEvent.DelayLock:
                PTDebug.Log("receive");
                var lockOnClickEventMsg = msg as UILockOnClickEventMsg;
                LockBtnOnClick = true;
                var delayNode = new DelayAction(lockOnClickEventMsg.LockTime)
                {
                    OnEndedCallback = delegate
                    {
                        LockBtnOnClick = false;
                    }
                };
                StartCoroutine(delayNode.Execute());
                break;

            case (ushort)UIFilterEvent.Lock:
                PTDebug.Log("Lock");
                Lock = true;
                break;

            case (ushort)UIFilterEvent.UnLock:
                PTDebug.Log("UnLock");
                Lock = false;
                break;

            case (int)UIFilterEvent.LockObjEvent:
            {
                var lockObjEventMsg = msg as UILockObjEventMsg;
                if (null == LockedObj)
                {
                    LockedObj = lockObjEventMsg.LockedObj;
                }
                else if (LockedObj == lockObjEventMsg.LockedObj)
                {
                    // maybe two finger in one obj
                    PTDebug.LogWarning("error: curLockedObj is already seted");
                }
                else if (LockedObj != lockObjEventMsg.LockedObj)
                {
                    throw new Exception("error: pre obj need unlocked");
                }
            }
            break;

            case (int)UIFilterEvent.UnlockObjEvent:
            {
                var unlockObjEventMsg = msg as UIUnlockObjEventMsg;
                if (unlockObjEventMsg.UnlockedObj == LockedObj)
                {
                    unlockObjEventMsg.UnlockedObj = null;
                    LockedObj = null;
                }
                else if (LockedObj == null)
                {
                    PTDebug.LogWarning("error: curLockedObj is already unlocked");
                }
                else if (LockedObj != unlockObjEventMsg.UnlockedObj)
                {
                    throw new Exception("error: pre obj need unlocked");
                }
            }
            break;
            }
        }