Ejemplo n.º 1
0
    void Update()
    {
        float acceleration = 0;

        if (delta > 0)
        {
            acceleration = move.GetMaxRotAcceleration();
        }
        else
        {
            acceleration = -move.GetMaxRotAcceleration();
        }

        move.Rotate(Mathf.Rad2deg(acceleration));

        if (Mathf.Abs(delta) <= rot_margin)
        {
            float ideal_velocity = delta / slow_angle;
            acceleration = ideal_velocity - move.GetCurrentRotVelocity();
        }
    }