private static void OnEnterFrame() { if (isShow == false) { return; } mouse = UICamera.lastTouchPosition; pos = mouse + offset; if (pos.y < height) { pos.y = height; } if (pos.x + width > Screen.width) { pos.x = mouse.x; pos.x = pos.x - width; } if (pos.x < 0) { pos.x = 0; } if (pos.y > Screen.height) { pos.y = Screen.height; } _container.transform.localPosition = UIUtil.BottomLeftToCenter(pos); }