public void MoveCharacterFootTo(Vector2 position, Vector2 normal, CharacterFoot foot, CharacterFoot.MoveCompleted moveCompleted, CharacterFoot.MoveInterrupted moveInterrupted) { Vector3[] chain = new Vector3[offsetChain.Length + 1]; for (int i = 0; i < offsetChain.Length; i++) { chain [i] = position + MultiplyVector(normal, offsetChain[i]); } chain [chain.Length - 1] = position; _moveCompleted = moveCompleted; _moveInterrupted = moveInterrupted; foot.MoveTo(chain, footTimePerUnit, CharacterFootMoveCompleted, CharacterFootMoveInterrupted); }
int SortLimbsByDirection(CharacterFoot a, CharacterFoot b) { float a_x = CachedTransform.position.x; float b_x = CachedTransform.position.x; if (a_x > b_x) { return(1); } else if (a_x < b_x) { return(-1); } else { return(0); } }