public static IEnumerator walkOneLeg(SimpleLeg leg1, SimpleLeg leg2) { MovementUtility.checkFeet(leg1, leg2); leg1.lower(); leg2.lift(); while(!leg1.isFullyLowered()) { Debug.DrawLine(leg1.thigh.transform.position, leg1.thigh.transform.position, Color.cyan); leg1.lower(); leg2.lift(); MovementUtility.checkFeet(leg1, leg2); yield return new WaitForFixedUpdate(); } yield return null; }
public static IEnumerator stand(SimpleLeg legOne, SimpleLeg legTwo) { legOne.footAdvanceFactor = 1f; legTwo.footAdvanceFactor = 1f; legOne.lower(); legTwo.lower(); if(SimpleLeg.getXAxisDiff(legOne, legTwo) < 0f) { legOne.advance(); legTwo.advanceOpposed(); }else{ legOne.advanceOpposed(); legTwo.advance(); } yield return new WaitForFixedUpdate(); }