Citrus 3 mēneši atpakaļ
vecāks
revīzija
f220e6b70e

+ 13 - 5
assets/Script/CommonUI/Gold.ts

@@ -15,18 +15,26 @@ const { ccclass, property } = cc._decorator;
 
 @ccclass
 export default class Gold extends MyComponent {
-
-    Label: cc.Label = null
+    @property(cc.Label)
+    Label: cc.Label
 
     onLoad(): void {
-        this.Label = this.node.getComponentInChildren(cc.Label) 
+        if (!this.Label) {
+            this.Label = this.node.getComponentInChildren(cc.Label)
+        }
     }
     start() {
         this.regEvent(EventName.changeGold, this.UpdataGold, this)
-    }
 
+        this.scheduleOnce(() => {
+            cc.systemEvent.emit(EventName.changeGold);
+        }, 0)
+    }
+ 
     UpdataGold() {
-        this.Label.string = LocalData.getInstance().getGold().toString()
+        if (this?.Label) {
+            this.Label.string = LocalData.getInstance().getGold().toString()
+        }
     }
 
     @ButtonLock(1, null)

+ 4 - 0
assets/Script/EventName/EventName.ts

@@ -47,6 +47,10 @@ export default class EventName {
     //展示引导
     static ShowGuide: string = 'ShowGuide'
 
+
+
+    //结束
+    static Over: string = 'Over'
 }
 
 

+ 2 - 1
assets/Script/GameProp/GameProp1002.ts

@@ -49,7 +49,8 @@ export default class GameProp1002 extends Prop {
     //奖励的方法
     Reaward() {
         console.error('ReawardGameProp1002');
-        
+
+        cc.systemEvent.emit(EventName.Over);
         let RoundState = this.getComponentInChildren(sp.Skeleton).setAnimation(0, '奖杯', false);
         this.scheduleOnce(() => {
             let NextLevel = cc.Canvas.instance.node.getChildByName('Map').getComponent(MyMap).MapjsonData.NextLevel

+ 30 - 0
assets/Script/Over.ts

@@ -0,0 +1,30 @@
+// Learn TypeScript:
+//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
+// Learn Attribute:
+//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
+// Learn life-cycle callbacks:
+//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
+
+import EventName from "./EventName/EventName";
+import MyComponent from "./Template/MyComponent";
+
+const { ccclass, property } = cc._decorator;
+
+@ccclass
+export default class Over extends MyComponent {
+    @property(cc.Label)
+    Hight: cc.Label = null;
+
+    @property(cc.Label)
+    label: cc.Label = null;
+
+    onLoad() {
+        this.regEvent(EventName.Over, this.Over, this)
+    }
+    Over() {
+        this.node.opacity = 255
+        this.label.string = this.Hight.string
+    }
+
+    // update (dt) {}
+}

+ 10 - 0
assets/Script/Over.ts.meta

@@ -0,0 +1,10 @@
+{
+  "ver": "1.1.0",
+  "uuid": "9a962b19-add1-4c97-a430-8c03a0e88d62",
+  "importer": "typescript",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 142 - 187
assets/sub/Scene/Game.fire


+ 3 - 0
assets/sub/Scene/Hall.fire

@@ -1764,6 +1764,9 @@
       "__id__": 26
     },
     "_enabled": true,
+    "Label": {
+      "__id__": 31
+    },
     "_id": "e1JKLRbwxJbLaILsuVRTPC"
   },
   {

+ 13 - 0
assets/sub/Texture/结算界面.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.3",
+  "uuid": "1353f0ea-12a4-4ced-9e9e-91202d0d4658",
+  "importer": "folder",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

BIN
assets/sub/Texture/结算界面/record.png


+ 38 - 0
assets/sub/Texture/结算界面/record.png.meta

@@ -0,0 +1,38 @@
+{
+  "ver": "2.3.7",
+  "uuid": "eaad90b0-116c-4028-ade7-d0c7bbc982d8",
+  "importer": "texture",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 575,
+  "height": 542,
+  "platformSettings": {},
+  "subMetas": {
+    "record": {
+      "ver": "1.0.6",
+      "uuid": "6a7119eb-4dfd-491a-b136-a34302c7f36d",
+      "importer": "sprite-frame",
+      "rawTextureUuid": "eaad90b0-116c-4028-ade7-d0c7bbc982d8",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 575,
+      "height": 542,
+      "rawWidth": 575,
+      "rawHeight": 542,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels