internal bool hasCollid(move elem) { RectangleF r1 = elem.mUI.drawRect.transform(elem.mUI.getLocalMatrix()); RectangleF r2 = mUI.drawRect.transform(mUI.getLocalMatrix()); if (r2.Contains(r1.leftTop())) return true; else if (r2.Contains(r1.rightBottom())) return true; else if (r1.Contains(r2.leftTop())) return true; return false; }
bool checkCollid(out move collider) { var collids = mWorld.getAllCollids(); bool isCollid = false; foreach (var elem in collids) { isCollid = elem.hasCollid(this); if (isCollid) { collider = elem; return true; } } collider = null; return false; }