Example #1
0
 void SetData(TFPData newData)
 {
     moving           = newData.moving;
     jumpHeld         = newData.jumpHeld;
     crouching        = newData.crouching;
     running          = newData.running;
     mouseLocked      = newData.mouseLocked;
     mouseLookEnabled = newData.mouseLookEnabled;
     jumpPressed      = newData.jumpPressed;
     xIn                 = newData.xIn;
     yIn                 = newData.yIn;
     xMouse              = newData.xMouse;
     yMouse              = newData.yMouse;
     jumping             = newData.jumping;
     grounded            = newData.grounded;
     timeSinceGrounded   = newData.timeSinceGrounded;
     yVel                = newData.yVel;
     slide               = newData.slide;
     gravMult            = newData.gravMult;
     currentStrafeMult   = newData.currentStrafeMult;
     currentBackwardMult = newData.currentBackwardMult;
     currentMoveSpeed    = newData.currentMoveSpeed;
     groundAngle         = newData.groundAngle;
     lastMove            = newData.lastMove;
     currentMove         = newData.currentMove;
     forward             = newData.forward;
     side                = newData.side;
     moveDelta           = newData.moveDelta;
     hitNormal           = newData.hitNormal;
     hitPoint            = newData.hitPoint;
     slideMove           = newData.slideMove;
     standingHeight      = newData.standingHeight;
     cameraOffset        = newData.cameraOffset;
 }
Example #2
0
        void ExecuteExtension(ExtFunc command)
        {
            if (!extensionsEnabled)
            {
                return;
            }
            TFPData data = GetData();

            foreach (TFPExtension extension in Extensions)
            {
                switch (command)
                {
                case ExtFunc.Start:
                    extension.ExStart(ref data, controllerInfo);
                    break;

                case ExtFunc.PreUpdate:
                    extension.ExPreUpdate(ref data, controllerInfo);
                    break;

                case ExtFunc.PostUpdate:
                    extension.ExPostUpdate(ref data, controllerInfo);
                    break;

                case ExtFunc.PreFixedUpdate:
                    extension.ExPreFixedUpdate(ref data, controllerInfo);
                    break;

                case ExtFunc.PostFixedUpdate:
                    extension.ExPostFixedUpdate(ref data, controllerInfo);
                    break;

                case ExtFunc.PreMove:
                    extension.ExPreMove(ref data, controllerInfo);
                    break;

                case ExtFunc.PreMoveCalc:
                    extension.ExPreMoveCalc(ref data, controllerInfo);
                    break;

                case ExtFunc.PostMove:
                    extension.ExPostMove(ref data, controllerInfo);
                    break;

                case ExtFunc.PostInput:
                    extension.ExPostInput(ref data, controllerInfo);
                    break;

                default:
                    break;
                }
            }
            SetData(data);
        }
        void ExecuteExtension(string command)
        {
            if (!extensionsEnabled)
            {
                return;
            }
            TFPData data = GetData();

            foreach (TFPExtension extension in Extensions)
            {
                switch (command)
                {
                case "Start":
                    extension.ExStart(ref data, controllerInfo);
                    break;

                case "PreUpdate":
                    extension.ExPreUpdate(ref data, controllerInfo);
                    break;

                case "PostUpdate":
                    extension.ExPostUpdate(ref data, controllerInfo);
                    break;

                case "FixedUpdate":
                    extension.ExFixedUpdate(ref data, controllerInfo);
                    break;

                case "PreMove":
                    extension.ExPreMove(ref data, controllerInfo);
                    break;

                default:
                    break;
                }
            }
            SetData(data);
        }
Example #4
0
 //Executes at the end of the move function at this point all movement for the frame has been handled
 public virtual void ExPostMove(ref TFPData data, TFPInfo info)
 {
 }
Example #5
0
 //executes at the end of the FixedUpdate function in FPSController.cs. Use for physics interactions
 public virtual void ExPostFixedUpdate(ref TFPData data, TFPInfo info)
 {
 }
Example #6
0
 //executes at the start of the Update function in FPSController.cs
 public virtual void ExPreUpdate(ref TFPData data, TFPInfo info)
 {
 }
Example #7
0
 //executes at the end of the Start function in FPSController.cs
 public virtual void ExStart(ref TFPData data, TFPInfo info)
 {
 }
Example #8
0
 //executes after input is retrieved, allows you to override input behaviour, useful for things like disabling jumping or running
 public virtual void ExPostInput(ref TFPData data, TFPInfo info)
 {
 }
Example #9
0
 //Executes before movement is calculated but after input is processed. This is useful if you want to modify variables that will be used in movement calculation
 public virtual void ExPreMoveCalc(ref TFPData data, TFPInfo info)
 {
 }