Unity编辑器 - DragAndDrop拖拽控件 Unity编辑器的拖拽(DragAndDrop)在网上能找到的资料少,自己稍微研究了一下,写了个相对完整的案例,效果如下 代码: object dragData = "dragData"; Vector2 offset; Color col = new Color(1, 0, 0, 0.6f); Rect rect1 = new Rect(20, 10, 100, 20); Rect rect2 = new Rect(20, 60,
Button vv = new Button("vvvv"); DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(vv, DnDConstants.ACTION_MOVE, new DragGestureListener(){ public void dragGestureRecognized(DragGestureEvent ee) { ee.startDrag(DragSource.D
键盘遮挡控件: super.viewDidLoad(){ // Do any additional setup after loading the view, typically from a nib. //监听键盘弹出通知 NotificationCenter.default.addObserver(self,selector: #selector(keyboardWillShow(_:)), name:UIResponder.keyboardWillShowNotification, obj