薛鸿潇 5 سال پیش
والد
کامیت
59d6a3d202

+ 41 - 0
assets/resources/animation/scale0To1.anim

@@ -0,0 +1,41 @@
+{
+  "__type__": "cc.AnimationClip",
+  "_name": "scale0To1",
+  "_objFlags": 0,
+  "_native": "",
+  "_duration": 0.25,
+  "sample": 60,
+  "speed": 1,
+  "wrapMode": 1,
+  "curveData": {
+    "props": {
+      "scale": [
+        {
+          "frame": 0,
+          "value": {
+            "__type__": "cc.Vec2",
+            "x": 0,
+            "y": 0
+          }
+        },
+        {
+          "frame": 0.18333333333333332,
+          "value": {
+            "__type__": "cc.Vec2",
+            "x": 1.2,
+            "y": 1.2
+          }
+        },
+        {
+          "frame": 0.25,
+          "value": {
+            "__type__": "cc.Vec2",
+            "x": 1,
+            "y": 1
+          }
+        }
+      ]
+    }
+  },
+  "events": []
+}

+ 5 - 0
assets/resources/animation/scale0To1.anim.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "2.1.0",
+  "uuid": "adac8e42-6b06-4cfa-b45e-1de293fd6675",
+  "subMetas": {}
+}

+ 4 - 4
assets/resources/game/prefab/game.prefab

@@ -2136,7 +2136,7 @@
       "ctor": "Float64Array",
       "array": [
         -160,
-        0,
+        50,
         0,
         0,
         0,
@@ -2182,7 +2182,7 @@
       "ctor": "Float64Array",
       "array": [
         180,
-        0,
+        50,
         0,
         0,
         0,
@@ -2227,8 +2227,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        80,
-        -150,
+        31,
+        -50,
         0,
         0,
         0,

+ 2 - 2
assets/resources/game/prefab/uiItem/redbagitem.prefab

@@ -58,8 +58,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        293.257,
-        0,
+        31,
+        -50,
         0,
         0,
         0,

+ 9 - 4
assets/script/game/game/Game.ts

@@ -30,7 +30,7 @@ export default class Game extends cc.Component {
     icon_hb: cc.Node = null;
     @property({ type: cc.Node, displayName: "金猪币图标" })
     icon_zb: cc.Node = null;
-    
+
     onLoad() {
         gData.gameData.gameStyle = this;
         mk.ui.closePanel("login");
@@ -56,9 +56,14 @@ export default class Game extends cc.Component {
     }
 
     private initQiPaos() {
-        cc.tween(this.btn_getRed1).to(2, { y: 100 }).to(2, { y: 0 }).union().repeatForever().start();
-        cc.tween(this.btn_getRed2).delay(0.3).to(2, { y: 100 }).to(2, { y: 0 }).union().repeatForever().start();
-        cc.tween(this.btn_getRed3).delay(0.6).to(2, { y: -50 }).to(2, { y: -150 }).union().repeatForever().start();
+        mk.tween.scale(this.btn_getRed1, 0.6, 0, 1, null, 'backOut');
+        mk.tween.scale(this.btn_getRed2, 0.6, 0, 1, null, 'backOut');
+        mk.tween.scale(this.btn_getRed3, 0.6, 0, 1, null, 'backOut');
+
+        let easing_type = '';//sineInOut
+        cc.tween(this.btn_getRed1).to(1.2, { y: 100 }, { easing: easing_type }).to(1.2, { y: 50 }, { easing: easing_type }).union().repeatForever().start();
+        cc.tween(this.btn_getRed2).delay(0.2).to(1.5, { y: 125 }, { easing: easing_type }).to(1.5, { y: 50 }, { easing: easing_type }).union().repeatForever().start();
+        cc.tween(this.btn_getRed3).delay(0.4).to(1, { y: 10 }, { easing: easing_type }).to(1, { y: -50 }, { easing: easing_type }).union().repeatForever().start();
     }
 
     private initInfo() {

+ 2 - 2
assets/script/mk/utils/TweenUtil.ts

@@ -19,9 +19,9 @@ export default class TweenUtil {
      * @param end_scale 目标缩放属性
      * @param complete_fun 完成回调
      */
-    public scale(node: cc.Node, time: number = 0.15, start_scale: number = 0, end_scale: number = 1, complete_fun?: Function) {
+    public scale(node: cc.Node, time: number = 0.15, start_scale: number = 0, end_scale: number = 1, complete_fun?: Function, easing?: keyof typeof TweenEasing) {
         node.scale = start_scale;
-        let scale1 = cc.tween().to(time, { scale: end_scale });
+        let scale1 = cc.tween().to(time, { scale: end_scale }, { easing: easing });
         let call1 = cc.tween().call(() => { if (typeof complete_fun == 'function') complete_fun(); })
         cc.tween(node).then(scale1).then(call1).start()
     }