コード例 #1
0
        // This event was created so that other components, particularly the Booster, could have a way to manipulate the controller.
        // See the way that class uses this event.
        private void OnStateChanged(ControllerState newState)
        {
            ControllerStateChangedEventArgs e = new ControllerStateChangedEventArgs(newState, mState);

            mState = newState;

            ControllerStateChangedEventHandler handler = StateChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
 private void ControllerStateChangedHandler(object sender, ControllerStateChangedEventArgs e)
 {
     if (e.NewState == BipedControllerComponent.ControllerState.Boosting)
     {
         mBoostTime                        = 0.0f;
         mRegularSpeed                     = mBipedControl.RunSpeed;
         mBipedControl.RunSpeed            = Speed;
         mRegularTurnLimit                 = mBipedControl.MaxTurnAnglePerTick;
         mBipedControl.MaxTurnAnglePerTick = TurnLimit;
     }
     else if (e.OldState == BipedControllerComponent.ControllerState.Boosting)
     {
         mBipedControl.RunSpeed            = mRegularSpeed;
         mBipedControl.MaxTurnAnglePerTick = mRegularTurnLimit;
     }
 }
コード例 #3
0
ファイル: Booster.cs プロジェクト: Tengato/Mechadrone1
 private void ControllerStateChangedHandler(object sender, ControllerStateChangedEventArgs e)
 {
     if (e.NewState == BipedControllerComponent.ControllerState.Boosting)
     {
         mBoostTime = 0.0f;
         mRegularSpeed = mBipedControl.RunSpeed;
         mBipedControl.RunSpeed = Speed;
         mRegularTurnLimit = mBipedControl.MaxTurnAnglePerTick;
         mBipedControl.MaxTurnAnglePerTick = TurnLimit;
     }
     else if (e.OldState == BipedControllerComponent.ControllerState.Boosting)
     {
         mBipedControl.RunSpeed = mRegularSpeed;
         mBipedControl.MaxTurnAnglePerTick = mRegularTurnLimit;
     }
 }
コード例 #4
0
        // This event was created so that other components, particularly the Booster, could have a way to manipulate the controller.
        // See the way that class uses this event.
        private void OnStateChanged(ControllerState newState)
        {
            ControllerStateChangedEventArgs e = new ControllerStateChangedEventArgs(newState, mState);
            mState = newState;

            ControllerStateChangedEventHandler handler = StateChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }