future 1 年之前
父节点
当前提交
4877bef875

+ 1 - 0
assets/data/data.ts

@@ -90,6 +90,7 @@ export class att_slide_data{
     public slide_dir:number = config.slide_type.down; //滑动方向
     public slide_distance:number = 100; //滑动的距离
     public slide_num:number = 1; //滑动次数
+    public other_widget_finish_listen_list:other_widget_finish_listen_item[] = [];
 }
 
 export class att_click_data{

+ 191 - 8
assets/resources/prefab/run/widget/widget_drag.prefab

@@ -17,21 +17,25 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": null,
-    "_children": [],
+    "_children": [
+      {
+        "__id__": 2
+      }
+    ],
     "_active": true,
     "_components": [
       {
-        "__id__": 2
+        "__id__": 10
       },
       {
-        "__id__": 4
+        "__id__": 12
       },
       {
-        "__id__": 6
+        "__id__": 14
       }
     ],
     "_prefab": {
-      "__id__": 8
+      "__id__": 16
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -62,6 +66,181 @@
     },
     "_id": ""
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "img_zhaobutong",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      },
+      {
+        "__id__": 7
+      }
+    ],
+    "_prefab": {
+      "__id__": 9
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 4
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c1mWopcuRN5a2AFt8f6Mf6"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 6
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "81848ce8-921b-4400-b961-a62e4d96f457@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "d7aqN4XZpPAImVTNFC7QF8"
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 8
+    },
+    "_alignFlags": 45,
+    "_target": null,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_horizontalCenter": 0,
+    "_verticalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 284,
+    "_originalHeight": 268,
+    "_alignMode": 2,
+    "_lockFlags": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c12X+WotBF/LzEOEVx8RRb"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "ba4iOtE7FMvY01Tox/gTpr",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
   {
     "__type__": "cc.UITransform",
     "_name": "",
@@ -72,7 +251,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 3
+      "__id__": 11
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -100,7 +279,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 5
+      "__id__": 13
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -142,11 +321,14 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 7
+      "__id__": 15
     },
     "icon": {
       "__id__": 1
     },
+    "img_zhaobutong": {
+      "__id__": 2
+    },
     "_id": ""
   },
   {
@@ -162,6 +344,7 @@
       "__id__": 0
     },
     "fileId": "9aIG8F/khCGrNfpgF8jMS5",
+    "instance": null,
     "targetOverrides": null
   }
 ]

+ 3 - 1
assets/script/run/scene_page.ts

@@ -126,7 +126,9 @@ export class scene_page extends Component {
             let widget_list = gameManager.getWidgetList(this.mData)
             for (let index = 0; index < widget_list.length; index++) {
                 const widget_data = widget_list[index];
-                if(widget_data.type == config.Widget_Type_List.CLICK_TYPE) {
+                if(widget_data.type == config.Widget_Type_List.CLICK_TYPE ||
+                    widget_data.type == config.Widget_Type_List.SLIDE_TYPE ||
+                    widget_data.type == config.Widget_Type_List.DRAG_TYPE) {
                     let item =  this.mWidgetList.get(widget_data.att.id)
                     item.getComponent(widget_base).hideZhaoButongFinishStatus()
                 }

+ 3 - 1
assets/script/run/widget/widget_click.ts

@@ -115,7 +115,9 @@ export class widget_click extends widget_base {
         this.img_zhaobutong.active = true;
     }
     public hideZhaoButongFinishStatus(): void {
-        this.img_zhaobutong.active = false;
+        if(this.img_zhaobutong != null) {
+            this.img_zhaobutong.active = false;
+        }
     }
 }
 

+ 19 - 0
assets/script/run/widget/widget_drag.ts

@@ -6,6 +6,7 @@ const { ccclass, property } = _decorator;
 
 @ccclass('widget_drag')
 export class widget_drag extends widget_base {
+    @property(Node) img_zhaobutong:Node = null;
     private mDragData:att_drag_data = null;
     private mIsStartMove:boolean = false;
     private offset_x:number = 0;
@@ -148,6 +149,24 @@ export class widget_drag extends widget_base {
         let is = this.getDragRect().contains(new Vec2(p.x,p.y))
         return is
     }
+
+    protected onFinishAnimation(): void {
+        this.icon.position = new Vec3(this.mData.att.x,this.mData.att.y)
+        // node.setSiblingIndex(node.parent.childrenCount - 1); 
+        // this.icon.setSiblingIndex(999)
+    }
+
+    public showZhaoButongFinishStatus(): void {
+        gameManager.Singleton.sys_click_correct_detail_music()
+        this.img_zhaobutong.active = true;
+        this.icon.position = new Vec3(this.mData.att.x,this.mData.att.y)
+    }
+
+    public hideZhaoButongFinishStatus(): void {
+        if(this.img_zhaobutong != null) {
+            this.img_zhaobutong.active = false;
+        }
+    }
 }
 
 

+ 12 - 1
assets/script/run/widget/widget_slide.ts

@@ -7,6 +7,7 @@ const { ccclass, property } = _decorator;
 
 @ccclass('widget_slide')
 export class widget_slide extends widget_base {
+    @property(Node) img_zhaobutong:Node = null;
     private mSlideData:att_slide_data = null;
     private mStartClickPos:Vec2 = null;
     private mCurSlideNum:number = 0;
@@ -154,7 +155,17 @@ export class widget_slide extends widget_base {
         this.mSlideFinishDown = false;
         this.mSlideFinishLeft = false;
         this.mSlideFinishRight = false;
-        
+    }
+
+    public showZhaoButongFinishStatus(): void {
+        gameManager.Singleton.sys_click_correct_detail_music()
+        this.img_zhaobutong.active = true;
+    }
+
+    public hideZhaoButongFinishStatus(): void {
+        if(this.img_zhaobutong != null) {
+            this.img_zhaobutong.active = false;
+        }
     }
 }