Guy.HoldUpAndMove C# (CSharp) Method

HoldUpAndMove() private method

private HoldUpAndMove ( object token, int direction ) : IEnumerator
token object
direction int
return IEnumerator
    IEnumerator HoldUpAndMove(object token, int direction)
    {
        var str = MainGuys[PlayerId].TotalAttachedGuys.Count / 10.0f + 1.0f;

        float t = 0;
        while (activeCoroutine == token && t < 0.25)
        {
            (direction == 1 ? RightLegRB : LeftLegRB).AddTorque(0, 0, 50 * direction * movementForce * str);
            (direction == -1 ? RightLegRB : LeftLegRB).AddForce(0, 10 * movementForce * str, 0);
            BodyRB.AddForce(40 * direction * movementForce * str, 0, 0);
            yield return new WaitForFixedUpdate();
            t += Time.fixedDeltaTime;
        }

        stabilize = true;

        t = 0;
        while (activeCoroutine == token && t < 0.4)
        {
            BodyRB.AddForce(-7.5f * -direction * movementForce * str, -10 * movementForce * str, 0);
            yield return new WaitForFixedUpdate();
            t += Time.fixedDeltaTime;
        }

        activeCoroutine = null;
        activeCoroutineDirection = 0;
    }