xx 1 жил өмнө
parent
commit
6e940f85be

+ 11 - 0
assets/script/run/bag/bag_drag_item.ts

@@ -32,6 +32,17 @@ export class bag_drag_item extends Component {
         })
     }
 
+
+    public DeleteSelf(){
+        this.unSelect()
+        this.node.off(Node.EventType.TOUCH_END)
+        this.node.removeFromParent()
+    }
+
+    public  isZero():boolean{
+        return this.drag_item.position.x==Vec3.ZERO.x&&this.drag_item.position.y==Vec3.ZERO.y
+    }
+
     public getData(){
         return this.mData;
     }

+ 15 - 1
assets/script/run/bag/dai_dao_ju_bag.ts

@@ -96,6 +96,14 @@ export class dai_dao_ju_bag extends Component {
         if(this.mScrollView!=null){
             this.action_node.position =  this.mScrollView.position;
         }
+
+        if(this.cur_select_item!=null){
+            if(!this.cur_select_item.isZero()){
+                this.EnabledScroll(false)
+            }else{
+                this.EnabledScroll(true)
+            }
+        }
     }
 
 
@@ -124,8 +132,10 @@ export class dai_dao_ju_bag extends Component {
     }
 
     onItemFinish(item:bag_drag_item){
-        item.node.removeFromParent()
         this.cur_select_item = null;
+        item.DeleteSelf()
+        this.action_node.off(Node.EventType.TOUCH_START)
+        this.btn_info.active = false;
         if(this.isFinishAll()){
             if( this.mData.finish_event_id!=-1){
                 gameManager.Singleton.exeEvent(this.mData.finish_event_id)
@@ -146,6 +156,10 @@ export class dai_dao_ju_bag extends Component {
         }
     }
 
+    EnabledScroll(enabled:boolean){
+        this.content.parent.parent.getComponent(ScrollView).enabled = enabled;
+    }
+
     addDragRect(r:Rect){
         // this.drag_des.position = new Vec3(r.x+r.width*0.5,r.y+r.height*0.5);
         // this.drag_des.getComponent(UITransform).setContentSize(new Size(r.width,r.height))