xx преди 11 месеца
родител
ревизия
0a864608a9

+ 32 - 0
assets/script/edit/Attributes.ts

@@ -586,6 +586,15 @@ export class Attributes extends Component {
                 if(widget.type!=config.Widget_Type_List.UI_TOP){
                     temp.push(widget)
                 }
+
+                if(widget.type==config.Widget_Type_List.CONTAINER_LAYER){
+                    if(widget.att.container_layer!=null){
+                        for (let j = 0; j <   widget.att.container_layer.widget_list.length; j++) {
+                            const container_widget = widget.att.container_layer.widget_list[j];
+                            temp.push(container_widget)
+                        }
+                    }
+                }
             }
         }
         return temp;
@@ -600,6 +609,17 @@ export class Attributes extends Component {
                 if(widget.att.id===id){
                     return widget;
                 }
+
+                if(widget.type==config.Widget_Type_List.CONTAINER_LAYER){
+                    if(widget.att.container_layer!=null){
+                        for (let j = 0; j <   widget.att.container_layer.widget_list.length; j++) {
+                            const container_widget = widget.att.container_layer.widget_list[j];
+                            if(container_widget.att.id===id){
+                                return container_widget;
+                            }
+                        }
+                    }
+                }
             }
         }
         return null;
@@ -616,6 +636,18 @@ export class Attributes extends Component {
                     page_index = index;
                     break;
                 }
+
+                if(widget.type==config.Widget_Type_List.CONTAINER_LAYER){
+                    if(widget.att.container_layer!=null){
+                        for (let j = 0; j <   widget.att.container_layer.widget_list.length; j++) {
+                            const container_widget = widget.att.container_layer.widget_list[j];
+                            if(container_widget.att.id===select_widget.att.id){
+                                page_index = index;
+                                break;
+                            }
+                        }
+                    }
+                }
             }
         }
         return page_index;

+ 1 - 1
assets/script/run/widget/widget_base.ts

@@ -257,7 +257,7 @@ export class widget_base extends Component {
                 self.icon.getComponent(Sprite).color = tar.color; 
                 self.icon.getComponent(UIOpacity).opacity = tar.opacity;
                 self.icon.getComponent(UITransform).setContentSize(tar.size)
-                self.icon.scale = tar.scale;
+                self.icon.scale = new Vec3(tar.scale.x,tar.scale.y,1);
                 // console.log('tar.anchorPointX_Y=',tar.anchorPointX,'-',tar.anchorPointY)
                 self.icon.getComponent(UITransform).setAnchorPoint(tar.anchorPointX, tar.anchorPointY)
                 if(self.mCurAnimation.isMove){

+ 0 - 15
assets/script/run/widget/widget_container.ts

@@ -12,21 +12,6 @@ export class widget_container extends widget_base {
             this.mContainerData = this.mData.att.container_layer
         }
     }
-
-    protected update(dt: number): void {
-    //    let node =  this.getIcon()
-    //    let origin_width =  this.mData.att.width
-    //    let origin_height = this.mData.att.height
-    //    let cur_width = node.getComponent(UITransform).contentSize.width
-    //    let cur_height = node.getComponent(UITransform).contentSize.height
-    //    let scaleX = cur_width/origin_width
-    //    let scaleY = cur_height/origin_height
- 
-    //    for (let index = 0; index < node.children.length; index++) {
-    //         const element = node.children[index];
-    //         element.setScale(scaleX,scaleY,1)
-    //    }
-    }
 }
 
 

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

@@ -326,7 +326,6 @@ export class widget_drag extends widget_base {
         }
         return list;
     }
-
 }
 
 

+ 27 - 0
assets/script/test1.ts

@@ -0,0 +1,27 @@
+import { _decorator, Component, Node, tween, Vec3 } from 'cc';
+const { ccclass, property } = _decorator;
+class BindTarget{
+    pos:Vec3;
+}
+@ccclass('test1')
+export class test1 extends Component {
+    private bindTarget:BindTarget = null;
+    @property(Node) test_btn:Node = null
+    protected start(): void {
+        this.test_btn.on(Node.EventType.TOUCH_START,()=>{
+            console.log("test_btn TOUCH_START")
+        })
+        this.bindTarget = new BindTarget();
+        this.bindTarget.pos = new Vec3(0,0)
+        let self = this
+        let color_opactiy_tw_size = tween(this.bindTarget).to(1,{pos:new Vec3(100,100)},{
+            onUpdate(tar:BindTarget) {
+                self.node.position = tar.pos
+            },
+        })
+       color_opactiy_tw_size.start();
+    }
+    
+}
+
+

+ 9 - 0
assets/script/test1.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "87f0aefa-a117-4e73-936c-c33064d0cbc9",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 216 - 15
assets/test.scene

@@ -52,7 +52,7 @@
     },
     "autoReleaseAssets": false,
     "_globals": {
-      "__id__": 53
+      "__id__": 59
     },
     "_id": "ae4a27b1-5809-444e-a772-54a37da3efd6"
   },
@@ -73,21 +73,24 @@
       },
       {
         "__id__": 22
+      },
+      {
+        "__id__": 49
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 49
+        "__id__": 55
       },
       {
-        "__id__": 50
+        "__id__": 56
       },
       {
-        "__id__": 51
+        "__id__": 57
       },
       {
-        "__id__": 52
+        "__id__": 58
       }
     ],
     "_prefab": null,
@@ -893,7 +896,7 @@
         "__id__": 40
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 47
@@ -1922,6 +1925,204 @@
     "_atlas": null,
     "_id": "6bSOl/NF5JTaHsuuwAGciA"
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "Node",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [
+      {
+        "__id__": 50
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 53
+      },
+      {
+        "__id__": 54
+      }
+    ],
+    "_prefab": null,
+    "_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": "8asENdEKZPga6FAnXZP8Iz"
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "SpriteSplash",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 49
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 51
+      },
+      {
+        "__id__": 52
+      }
+    ],
+    "_prefab": null,
+    "_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": "cbWaW7M9NKGZajtpPG4Irq"
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 50
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 200,
+      "height": 200
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": "5cpcRWrW5KTLQLdeCdHgZh"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 50
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@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": "1e9FznbDNEHpxNyDiQ8Y2z"
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 49
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 200,
+      "height": 200
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": "bfWnOVNkhHUr4YL+DLi7Hz"
+  },
+  {
+    "__type__": "87f0a76oRdOc5NswzBk0MvJ",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 49
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "test_btn": {
+      "__id__": 50
+    },
+    "_id": "a2aVPHmslKN4pJCpPiKFbT"
+  },
   {
     "__type__": "cc.UITransform",
     "_name": "",
@@ -1998,7 +2199,7 @@
     "node": {
       "__id__": 2
     },
-    "_enabled": true,
+    "_enabled": false,
     "__prefab": null,
     "draw_bg": {
       "__id__": 22
@@ -2023,28 +2224,28 @@
   {
     "__type__": "cc.SceneGlobals",
     "ambient": {
-      "__id__": 54
+      "__id__": 60
     },
     "shadows": {
-      "__id__": 55
+      "__id__": 61
     },
     "_skybox": {
-      "__id__": 56
+      "__id__": 62
     },
     "fog": {
-      "__id__": 57
+      "__id__": 63
     },
     "octree": {
-      "__id__": 58
+      "__id__": 64
     },
     "skin": {
-      "__id__": 59
+      "__id__": 65
     },
     "lightProbeInfo": {
-      "__id__": 60
+      "__id__": 66
     },
     "postSettings": {
-      "__id__": 61
+      "__id__": 67
     },
     "bakedWithStationaryMainLight": false,
     "bakedWithHighpLightmap": false