private int LastBodyMeet(XBoxComponent hc1, XBoxComponent hc2) { XBodyMoveRectBox rb1 = hc1.GetBodyMoveBox(); XBodyMoveRectBox rb2 = hc2.GetBodyMoveBox(); if (rb1 == null || rb2 == null) { return(-1); } XBoxRect box = XBoxRect.Overlap(rb1, rb2); return(box.Width); }
private void BodyMoveStep(XBoxComponent hc, int x, int y) { if (Mathf.Abs(hc.GetBodyMoveBox().MoveX) >= Mathf.Abs(x)) { hc.GetBodyMoveBox().MoveX -= x; } else { hc.GetBodyMoveBox().MoveX = 0; } if (Mathf.Abs(hc.GetBodyMoveBox().MoveY) >= Mathf.Abs(y)) { hc.GetBodyMoveBox().MoveY -= y; } else { hc.GetBodyMoveBox().MoveY = 0; } }