소스 검색

youhua reward_box

future 1 년 전
부모
커밋
c31c4c580e

+ 181 - 0
assets/animation/reward_box_animation.anim

@@ -0,0 +1,181 @@
+[
+  {
+    "__type__": "cc.AnimationClip",
+    "_name": "reward_box_animation",
+    "_objFlags": 0,
+    "__editorExtras__": {
+      "embeddedPlayerGroups": []
+    },
+    "_native": "",
+    "sample": 60,
+    "speed": 0.6,
+    "wrapMode": 22,
+    "enableTrsBlending": false,
+    "_duration": 0.3333333333333333,
+    "_hash": 500763545,
+    "_tracks": [
+      {
+        "__id__": 1
+      }
+    ],
+    "_exoticAnimation": null,
+    "_events": [
+      {
+        "frame": 0.3333333333333333,
+        "func": "",
+        "params": []
+      }
+    ],
+    "_embeddedPlayers": [],
+    "_additiveSettings": {
+      "__id__": 11
+    },
+    "_auxiliaryCurveEntries": []
+  },
+  {
+    "__type__": "cc.animation.VectorTrack",
+    "_binding": {
+      "__type__": "cc.animation.TrackBinding",
+      "path": {
+        "__id__": 2
+      },
+      "proxy": null
+    },
+    "_channels": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      },
+      {
+        "__id__": 7
+      },
+      {
+        "__id__": 9
+      }
+    ],
+    "_nComponents": 3
+  },
+  {
+    "__type__": "cc.animation.TrackPath",
+    "_paths": [
+      "eulerAngles"
+    ]
+  },
+  {
+    "__type__": "cc.animation.Channel",
+    "_curve": {
+      "__id__": 4
+    }
+  },
+  {
+    "__type__": "cc.RealCurve",
+    "_times": [
+      0
+    ],
+    "_values": [
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 0,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": null
+      }
+    ],
+    "preExtrapolation": 1,
+    "postExtrapolation": 1
+  },
+  {
+    "__type__": "cc.animation.Channel",
+    "_curve": {
+      "__id__": 6
+    }
+  },
+  {
+    "__type__": "cc.RealCurve",
+    "_times": [
+      0
+    ],
+    "_values": [
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 0,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": null
+      }
+    ],
+    "preExtrapolation": 1,
+    "postExtrapolation": 1
+  },
+  {
+    "__type__": "cc.animation.Channel",
+    "_curve": {
+      "__id__": 8
+    }
+  },
+  {
+    "__type__": "cc.RealCurve",
+    "_times": [
+      0,
+      0.3333333432674408
+    ],
+    "_values": [
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 15,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": null
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": -15,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": null
+      }
+    ],
+    "preExtrapolation": 1,
+    "postExtrapolation": 1
+  },
+  {
+    "__type__": "cc.animation.Channel",
+    "_curve": {
+      "__id__": 10
+    }
+  },
+  {
+    "__type__": "cc.RealCurve",
+    "_times": [],
+    "_values": [],
+    "preExtrapolation": 1,
+    "postExtrapolation": 1
+  },
+  {
+    "__type__": "cc.AnimationClipAdditiveSettings",
+    "enabled": false,
+    "refClip": null
+  }
+]

+ 13 - 0
assets/animation/reward_box_animation.anim.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "2.0.3",
+  "importer": "animation-clip",
+  "imported": true,
+  "uuid": "f51a335c-56e5-4041-b881-1db9e04445d2",
+  "files": [
+    ".cconb"
+  ],
+  "subMetas": {},
+  "userData": {
+    "name": "reward_box_animation"
+  }
+}

+ 17 - 6
assets/scene/game.scene

@@ -717,7 +717,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 8.896250229473262,
+      "width": 8.897383539727393,
       "height": 20.16
     },
     "_anchorPoint": {
@@ -750,7 +750,7 @@
     "_string": "0",
     "_horizontalAlign": 0,
     "_verticalAlign": 1,
-    "_actualFontSize": 20.334975369458128,
+    "_actualFontSize": 18.52216748768473,
     "_fontSize": 16,
     "_fontFamily": "Arial",
     "_lineHeight": 16,
@@ -1887,7 +1887,7 @@
     "_id": "16nr7lXjZF3b7GR+B20mOK"
   },
   {
-    "__type__": "17d73e2Ap9E1J8r58rA45Cw",
+    "__type__": "cc.Animation",
     "_name": "",
     "_objFlags": 0,
     "__editorExtras__": {},
@@ -1896,7 +1896,18 @@
     },
     "_enabled": true,
     "__prefab": null,
-    "_id": "69zphLmERA2ItjZj/JNDRd"
+    "playOnLoad": false,
+    "_clips": [
+      {
+        "__uuid__": "f51a335c-56e5-4041-b881-1db9e04445d2",
+        "__expectedType__": "cc.AnimationClip"
+      }
+    ],
+    "_defaultClip": {
+      "__uuid__": "f51a335c-56e5-4041-b881-1db9e04445d2",
+      "__expectedType__": "cc.AnimationClip"
+    },
+    "_id": "fcrzCTuQxDoI1SrToR45QU"
   },
   {
     "__type__": "cc.UITransform",
@@ -2809,7 +2820,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 87.50582081402919,
+      "width": 87.50151808718417,
       "height": 25.2
     },
     "_anchorPoint": {
@@ -2842,7 +2853,7 @@
     "_string": "加载中50%...",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 19.064039408866996,
+    "_actualFontSize": 17.364532019704434,
     "_fontSize": 15,
     "_fontFamily": "Arial",
     "_lineHeight": 20,

+ 4 - 5
assets/script/homepage/homepage.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, Director, director, Enum, Game, game, instantiate, Label, log, Node, Prefab, resources, SpriteFrame, sys, tween, UITransform, Vec2, Vec3 } from 'cc';
+import { _decorator, Component, Director, director, Enum, Game, game, instantiate, Label, log, Node, Prefab, resources, SpriteFrame, sys, tween, UITransform, Vec2, Vec3, Animation } from 'cc';
 import { config } from '../config';
 import { gameManager } from '../gameManager';
 import { play_list_item } from './play_list_item';
@@ -21,7 +21,6 @@ import { view_game_play_ji_yi_li } from '../play_list/ji_yi_li/view_game_play_ji
 import { view_game_play_zhao_bu_tong } from '../play_list/zhao_bu_tong/view_game_play_zhao_bu_tong';
 import { StatisticsManager } from '../framework/statisticsManager';
 import { reward_box_page } from './reward_box_page';
-import { reward_box } from './reward_box';
 const { ccclass, property } = _decorator;
 export enum ETest {
     None = 0,
@@ -81,10 +80,10 @@ export class homepage extends Component {
         ClientEvent.on(config.EVENT_MSG.ON_SHOW_REWARD_VIEW,this.onShowRewardView.bind(this),this);
         ClientEvent.on(config.EVENT_MSG.ON_USER_LOGIN_SUCCESS,this.onUserLoginSuccess.bind(this),this);
     }
-    onUserLoginSuccess() {  
+    onUserLoginSuccess() {      
         if(SdkUtil.ttCheckSceneShowRewards()&&gameManager.get_user_is_sign()==false) {
             this.reward_box.active = true
-            this.reward_box.getComponent(reward_box).playShake()
+            this.reward_box.getComponent(Animation).play()
             let self = this
             this.reward_box.on(Node.EventType.TOUCH_END, ()=> {
                 gameManager.addTopView(config.PREFAB_PATH.reward_box_page, (node:Node)=> {
@@ -98,7 +97,7 @@ export class homepage extends Component {
                         },500)
                         self.showCoinAni()
                         reward_box_page.close()
-                        this.reward_box.getComponent(reward_box).stopShake()
+                        this.reward_box.getComponent(Animation).stop()
                         this.reward_box.active = false
                     })
                 })

+ 0 - 26
assets/script/homepage/reward_box.ts

@@ -1,26 +0,0 @@
-import { _decorator, Component, Node, tween } from 'cc';
-const { ccclass, property } = _decorator;
-
-@ccclass('reward_box')
-export class reward_box extends Component {
-    
-    protected m_interval:any = null
-
-    playShake() {
-        let angle_number:number = 15
-        var shake_angle:number = angle_number;
-        this.m_interval = setInterval(()=> {
-            tween(this.node).to(0.5, { angle: shake_angle }).start()
-            if(shake_angle == angle_number) {
-                shake_angle = -angle_number
-            } else {
-                shake_angle = angle_number
-            }
-        }, 300)
-    }
-
-    stopShake() {
-        clearInterval(this.m_interval)
-    }
-}
-