Example #1
0
        public void update(bool callCallBack = true)
        {
            if (!_Animating)
            {
                return;
            }

            if (_TimeElapsed < _Duration)
            {
                if (_Easing == null)
                {
                    return;
                }

                _Progression = _Easing.Invoke(_TimeElapsed, _From, (_To - _From), _Duration);

                _ProgressPct = _TimeElapsed / _Duration;

                _TimeElapsed += Time.deltaTime;
            }
            else
            {
                _Progression = _To;

                _Animating   = false;
                _TimeElapsed = 0.0f;
                _ProgressPct = 1.0f;

                if (callCallBack && _Callback != null)
                {
                    _Callback.Invoke();
                }
            }
        }
Example #2
0
    public void update(bool callCallBack = true)
    {
        if (_Animating)
        {
            if (_TimeElapsed < _Duration)
            {
                if (_Easing != null)
                {
                    _Progression.x = _Easing.Invoke(_TimeElapsed, _From.x, (_To.x - _From.x), _Duration);
                    _Progression.y = _Easing.Invoke(_TimeElapsed, _From.y, (_To.y - _From.y), _Duration);
                    _Progression.z = _Easing.Invoke(_TimeElapsed, _From.z, (_To.z - _From.z), _Duration);

                    _ProgressPct = _TimeElapsed / _Duration;

                    _TimeElapsed += Time.deltaTime;
                }
            }
            else
            {
                _Progression = _To;

                _Animating   = false;
                _TimeElapsed = 0f;
                _ProgressPct = 1f;

                if (callCallBack && _Callback != null)
                {
                    _Callback.Invoke();
                }
            }
        }
    }
Example #3
0
        public void CheckUpdate(bool callCallBack = true)
        {
            if (_AnimatingX && _AnimatingY && _AnimatingZ)
            {
                return;
            }

            if (callCallBack && _Callback != null)
            {
                _Callback.Invoke();
            }
        }
Example #4
0
        private void SafeDoCallback()
        {
            if (mDestinationCallback == null)
            {
                return;
            }

            if (!this.mDoneTweenX || !this.mDoneTweenY || !this.mDoneTweenZ)
            {
                return;
            }

            mDestinationCallback.Invoke();
        }
Example #5
0
 private void ViewToBW(object sender, RoutedEventArgs e)
 {
     if (SelectedItem != null)
     {
         var project = Model.Instances.FirstOrDefault <IIfcProject>();
         if (project is Xbim.Ifc2x3.Kernel.IfcProject)
         {
             var sel = SelectedItem as Xbim.Ifc2x3.Interfaces.IIfcRoot;
             if (sel != null)
             {
                 _Callback?.Invoke(sel.GlobalId.ToString());
             }
         }
         else if (project is Xbim.Ifc4.Kernel.IfcProject)
         {
             var selected = SelectedItem as Xbim.Ifc4.Interfaces.IIfcRoot;
             if (selected != null)
             {
                 _Callback?.Invoke(selected.GlobalId.ToString());
             }
         }
     }
 }
Example #6
0
        /// <summary>
        /// Check weather if the easing are done.
        /// </summary>
        private void DoDoneEasing()
        {
            // trigger callback.
            if (mValueCallback != null)
            {
                mValueCallback.Invoke();
            }

            // trigger unity callback.
            if (mUnityCallback != null)
            {
                mUnityCallback.Invoke();
            }
        }
        /// <summary>
        /// Check weather if the easing are done.
        /// </summary>
        private void CheckDoneEasing()
        {
            // check if any still easing.
            if (mEasingA || mEasingR || mEasingG || mEasingB)
                return;


            // trigger callback.
            if (mColorCallback != null)
                mColorCallback.Invoke();

            // trigger unity callback.
            if (mUnityCallback != null)
                mUnityCallback.Invoke();
        }
Example #8
0
 private void PopForm_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if (titlebarRectangle.Contains(e.Location))               //单击标题栏时拖动
         {
             ReleaseCapture();                                     //释放鼠标捕捉
             SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); //发送左键点击的消息至该窗体(标题栏)
         }
         if (closeRectangle.Contains(e.Location))                  //单击Close按钮关闭
         {
             this.Hide();
             currentTop = 1;
         }
         if (contentRectangle.Contains(e.Location))  //单击内容区域
         {
             if (myDelegate != null)
             {
                 myDelegate.Invoke(this.contentText);
             }
         }
     }
 }
 public void DoSomething(CallBackDelegate callBack)
 {
     Console.WriteLine("hello from DoSomething()!");
     callBack?.Invoke("hello world!");
     Console.WriteLine("DoSomething() Ending!");
 }