private void MoveStateChangeHandler(ICanChangeMoveState moveState, MovingEventArgs eventArgs)
 {
     if (eventArgs.currentMovingState == MovingState.Move &&
         _fSM.GetCurrentAnimation().name == PlayerFSMData.Anim.Run_Ground)
     {
         _particles["Run_Ground"].Play();
         _repeatFootstepSFX = true;
     }
     else
     {
         _particles["Run_Ground"].Stop();
         _repeatFootstepSFX = false;
     }
     if (eventArgs.currentMovingState == MovingState.Airborne)
     {
         _particles["Jump_In_Air"].Play();
         int    i = Random.Range(0, 4);
         string j = i.ToString();
         _playerAudioSource.clip   = _audios["Jump" + j];
         _playerAudioSource.volume = _volume["Jump" + j];
         _playerAudioSource.pitch  = _pitch["Jump" + j];
         _playerAudioSource.Play();
     }
     if (eventArgs.currentMovingState == MovingState.Dash)
     {
         _playerAudioSource.clip   = _audios["Dash"];
         _playerAudioSource.volume = _volume["Dash"];
         _playerAudioSource.pitch  = _pitch["Dash"];
         _playerAudioSource.Play();
     }
 }
Exemplo n.º 2
0
 protected override void OnMoving(object sender, MovingEventArgs movingEventArgs)
 {
     if (_browserWindowHandle != IntPtr.Zero)
     {
         Browser.CefBrowser.GetHost().NotifyMoveOrResizeStarted();
     }
 }
Exemplo n.º 3
0
        private void OurWndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case 0x0216:     // WM_MOVING
                unsafe
                {
                    int *     p    = (int *)m.LParam;
                    Rectangle rect = Rectangle.FromLTRB(p[0], p[1], p[2], p[3]);

                    var mea = new MovingEventArgs(rect);
                    OnMoving(mea);

                    p[0] = mea.Rectangle.Left;
                    p[1] = mea.Rectangle.Top;
                    p[2] = mea.Rectangle.Right;
                    p[3] = mea.Rectangle.Bottom;

                    m.Result = new IntPtr(1);
                }
                break;

            // WinForms doesn't handle this message correctly and wrongly returns 0 instead of 1.
            case 0x0011:     // WM_QUERYENDSESSION
                CancelEventArgs e = new CancelEventArgs();
                OnQueryEndSession(e);
                m.Result = e.Cancel ? IntPtr.Zero : new IntPtr(1);
                break;

            default:
                base.WndProc(ref m);
                break;
            }
        }
Exemplo n.º 4
0
 protected virtual void OnMoving(MovingEventArgs mea)
 {
     if (Moving != null)
     {
         Moving(this, mea);
     }
 }
Exemplo n.º 5
0
 private void HandleMovingStateChanged(ICanChangeMoveState sender, MovingEventArgs eventArgs)
 {
     if (eventArgs.lastMovingState == MovingState.Dash)
     {
         _animator.SetToggle(PlayerFSMData.Stat.DashEnd, true);
     }
 }
Exemplo n.º 6
0
        protected override void OnMoving(MovingEventArgs mea)
        {
            ISnapManagerHost owner = base.Owner as ISnapManagerHost;

            if (owner != null)
            {
                SnapManager snapManager = owner.SnapManager;
                if (!this.isMoving)
                {
                    this.movingCursorDelta = new Size(Cursor.Position.X - mea.Rectangle.X, Cursor.Position.Y - mea.Rectangle.Y);
                    this.isMoving          = true;
                }
                mea.Rectangle = new Rectangle(Cursor.Position.X - this.movingCursorDelta.Width, Cursor.Position.Y - this.movingCursorDelta.Height, mea.Rectangle.Width, mea.Rectangle.Height);
                this.snapObstacle.SetBounds(mea.Rectangle.ToRectInt32());
                PointInt32 newLocation = mea.Rectangle.Location.ToPointInt32();
                PointInt32 location    = snapManager.AdjustObstacleDestination(this.SnapObstacle, newLocation);
                RectInt32  bounds      = new RectInt32(location, mea.Rectangle.Size.ToSizeInt32());
                this.snapObstacle.SetBounds(bounds);
                mea.Rectangle = bounds.ToGdipRectangle();
            }
            base.OnMoving(mea);
        }
 protected virtual void OnWindowMoving(object sender, MovingEventArgs movingEventArgs)
 {
     _window?.NotifyOnMove();
 }
Exemplo n.º 8
0
 static void student_moving(object sender, MovingEventArgs e)
 {
     Console.WriteLine(e.Message);
 }
Exemplo n.º 9
0
 protected virtual void OnMoving(object sender, MovingEventArgs movingEventArgs)
 {
 }
Exemplo n.º 10
0
 protected virtual void OnRaiseFileAlreadyExistsEvent(MovingEventArgs ruleEventArgs)
 {
     FileAlreadyExistsEvent?.Invoke(this, ruleEventArgs);
 }
Exemplo n.º 11
0
 protected virtual void OnRaiseFileMovedEvent(MovingEventArgs movingEventArgs)
 {
     FileMovedEvent?.Invoke(this, movingEventArgs);
 }