private void FixedUpdate()
    {
        Status.CachePreviousStatus();
        CalculateCurrentStatus();

        currentStateClass?.TickFixedUpdate();

        ExecuteRigidbodyVelocity();
    }
Пример #2
0
    void FixedUpdate()
    {
        status.CacheCurrentValuesToOld(); //Cache the values in the previous frame before we update them
        raycaster.UpdateOriginPoints();   //We use a specialist raycaster class to do all the raycasting logic
        CacheStatusCalculations();        //Certain calculations can be done once and cached for all scripts to use later.

        currentStateClass?.TickFixedUpdate();

        rb.velocity = status.currentVelocity; //After all velocity calculations are finalized, we assign it to the rigidbody
    }