wuwangdong 4 سال پیش
والد
کامیت
9083e0c733
2فایلهای تغییر یافته به همراه36 افزوده شده و 7 حذف شده
  1. 5 4
      assets/resources/module/newCashUI/walletCashOut.prefab
  2. 31 3
      assets/script/game/component/tween/TweenCast.ts

+ 5 - 4
assets/resources/module/newCashUI/walletCashOut.prefab

@@ -903,7 +903,7 @@
     "asset": {
       "__uuid__": "e3718e3b-b05d-4d23-9195-924548d5c740"
     },
-    "fileId": "07Y1fs49FNAo225otyxY7c",
+    "fileId": "d2a/7Q+cxIFJkombpDdWtK",
     "sync": false
   },
   {
@@ -938,9 +938,10 @@
     "rich_text": {
       "__id__": 21
     },
-    "display_time": 5,
-    "move_speed": 3,
-    "wait_time": 10,
+    "display_time": 6,
+    "move_speed": 1,
+    "wait_time": 6,
+    "scrollType": 1,
     "_id": ""
   },
   {

+ 31 - 3
assets/script/game/component/tween/TweenCast.ts

@@ -1,9 +1,18 @@
+import { RewardType } from "../../data/GameData";
+
 
 const { ccclass, property } = cc._decorator;
 /**
  * 世界公告 滚动播放
  * @author 邹勇
  */
+
+const ScrollType = cc.Enum({
+    ST_horizontal : 0,
+    ST_vertical : 1,
+});
+
+
 @ccclass
 export default class TweenCast extends cc.Component {
     @property({ type: cc.RichText, displayName: "公告内容" })
@@ -14,6 +23,8 @@ export default class TweenCast extends cc.Component {
     private move_speed: number = 3;
     @property({ displayName: "等待时间" })
     private wait_time: number = 10;
+    @property({displayName: '滚动方向', type: ScrollType})
+    private scrollType = ScrollType.ST_horizontal;
 
     private names: string[] = ["拒绝寂寞", "孽緣", "祗為与妳相爱", "羙男", "浅蓝", "腊笔小东", "卡布奇诺", "苊狠幸福", "埋葬回忆", "早已该放手", "白兎",
         "豿疍疍", "宿命", "渗透的葬礼", "全都是虚假", "俄侑伱-直", "隱裑", "你不配我", "非主流网名", "剧终", "如果沵走了", "續雪", "默默然", "大白痴", "衮开",
@@ -54,16 +65,33 @@ export default class TweenCast extends cc.Component {
 
     private rickPlay() {
         this.node.active = true;
-        cc.tween(this.rich_text.node)
+        if(this.scrollType == ScrollType.ST_horizontal)
+        {
+            cc.tween(this.rich_text.node)
             .to(this.move_speed, { x: 16 })
             .delay(this.display_time)
             .to(this.move_speed, { x: -450 })
             .call(this.play.bind(this)).start();
+        }else{
+            cc.tween(this.rich_text.node)
+            .to(this.move_speed, { y: 0 }, cc.easeSineOut())
+            .delay(this.display_time)
+            .to(this.move_speed, { y: 50 })
+            .call(this.play.bind(this)).start();
+        }
+        
     }
 
     private reset() {
         this.node.active = false;
-        this.rich_text.node.x = 450;
-        this.rich_text.string = this.getContent();
+        if(this.scrollType == ScrollType.ST_horizontal)
+        {
+            this.rich_text.node.x = 450;
+            this.rich_text.string = this.getContent();
+        }else{
+            this.rich_text.node.y = -50;
+            this.rich_text.string = this.getContent();
+        }
+        
     }
 }