コード例 #1
0
 public static float GetGravityFake()
 {
     return(Physics.gravity.y * Universals.GetTimeFake());
 }
コード例 #2
0
    private void MovementLerpUnifiedXZ()
    {
        //Debug.Log(velocity_endgoal);

        float ratio;

        if (Mathf.Abs(velocity_endgoal.x - velocity.x)
            > Mathf.Abs(velocity_endgoal.z - velocity.z))
        {
            ratio      = Mathf.Abs(velocity_endgoal.z - velocity.z) / Mathf.Abs(velocity_endgoal.x - velocity.x);
            velocity.x = Universals.LerpBetter(velocity.x, velocity_endgoal.x, acceleration_true * Universals.GetTimeFake());
            velocity.z = Universals.LerpBetter(velocity.z, velocity_endgoal.z, acceleration_true * ratio * Universals.GetTimeFake());
        }
        else
        {
            ratio      = Mathf.Abs(velocity_endgoal.x - velocity.x) / Mathf.Abs(velocity_endgoal.z - velocity.z);
            velocity.z = Universals.LerpBetter(velocity.z, velocity_endgoal.z, acceleration_true * Universals.GetTimeFake());
            velocity.x = Universals.LerpBetter(velocity.x, velocity_endgoal.x, acceleration_true * ratio * Universals.GetTimeFake());
        }
    }