浏览代码

1、添加光芒旋转动画

Sunny 3 年之前
父节点
当前提交
fedb5b7ae1
共有 5 个文件被更改,包括 309 次插入171 次删除
  1. 257 159
      assets/Scene/MyCityScene - 004.fire
  2. 17 11
      assets/Script/public/ManageUI.js
  3. 二进制
      assets/UI/Tips/LightRotate.png
  4. 34 0
      assets/UI/Tips/LightRotate.png.meta
  5. 1 1
      settings/project.json

文件差异内容过多而无法显示
+ 257 - 159
assets/Scene/MyCityScene - 004.fire


+ 17 - 11
assets/Script/public/ManageUI.js

@@ -80,11 +80,12 @@ cc.Class({
     ExchangeBtn: cc.Button,
     //钻石足够获得种子
     DiamondSeedsView: cc.Node,
+    LightRotate: cc.Node,
     DiamondSeeds_SureBtn: cc.Button,
 
     inviteNode: cc.Node,
 
-    listUserInfoNode:cc.Node,
+    listUserInfoNode: cc.Node,
 
     //商店面的介绍模板
     mallContent_Name: cc.Label,
@@ -595,15 +596,16 @@ cc.Class({
   },
 
   onListUserInfo_Open() {
-    this.listUserInfoNode.getComponent('userListInfo').onOpen();
+    this.listUserInfoNode.getComponent('userListInfo').onOpen()
   },
 
   //点击钻石兑换
   onButtonEvent_Exchange() {
-    this.onSetTouchStatus(this.DiamondGapView, true)
+    this.DiamondGapView.active = true
+    // this.onSetTouchStatus(this.DiamondGapView, true)
     //判断钻石数量是否大于等于3万个
     if (GlobalD.GameData.GetDiamond() < 30000) {
-      this.ExchangeBtn.interactable = true
+      this.ExchangeBtn.interactable = false
       // GlobalD.GameData.showToast(
       //   cc.find('Canvas/UICamera'),
       //   '钻石数量不够,累积到30000个钻石即可免费兑换一包辣椒种子。',
@@ -616,7 +618,7 @@ cc.Class({
   },
   //点击取消钻石兑换
   onButtonEvent_ExchangeCancel() {
-    this.onSetTouchStatus(this.DiamondGapView, false)
+    this.DiamondGapView.active = false
   },
 
   //点击确认钻石兑换辣椒种子
@@ -624,6 +626,7 @@ cc.Class({
     let diamonAmount = 30000
     //调用兑换接口
     GlobalD.GameData.exchangeSeed(diamonAmount, (value) => {
+      return
       //兑换成功
       if (0 === value.code) {
         var BuildingView = cc
@@ -631,21 +634,24 @@ cc.Class({
           .getComponent('BuildingView')
         BuildingView.onUpdateList()
 
-        this.onSetTouchStatus(this.DiamondGapView, false)
-        this.onSetTouchStatus(this.DiamondSeedsView, true)
+        this.DiamondGapView.active = false
+        this.DiamondSeedsView.active = true
+
+        //光芒旋转
+        var rotate = cc.repeatForever(cc.rotateBy(2, -100, 0))
+        this.LightRotate.runAction(rotate)
       } else {
         //兑换失败
         GlobalD.GameData.showToast(cc.find('Canvas/UICamera'), value.msg, 2)
-        this.onSetTouchStatus(this.DiamondGapView, false)
-        this.onSetTouchStatus(this.DiamondSeedsView, true)
       }
     })
   },
 
   //点击钻石兑换的确认按钮
   onButtonEvent_DiamondSure() {
-    this.onSetTouchStatus(this.DiamondSeedsView, false)
-    this.onSetTouchStatus(this.DiamondGapView, false)
+    this.DiamondSeedsView.active = false
+    //停止光芒旋转
+    this.LightRotate.stopAllActions()
   },
 
   //音效设置界面

二进制
assets/UI/Tips/LightRotate.png


+ 34 - 0
assets/UI/Tips/LightRotate.png.meta

@@ -0,0 +1,34 @@
+{
+  "ver": "2.3.3",
+  "uuid": "b9d393fe-cf71-482a-918e-b50c34c77541",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "platformSettings": {},
+  "subMetas": {
+    "LightRotate": {
+      "ver": "1.0.4",
+      "uuid": "de6dbaf1-42fd-4d1e-8191-e27f2a480d51",
+      "rawTextureUuid": "b9d393fe-cf71-482a-918e-b50c34c77541",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 1031,
+      "height": 1037,
+      "rawWidth": 1031,
+      "rawHeight": 1037,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 1 - 1
settings/project.json

@@ -45,7 +45,7 @@
     "height": 640,
     "width": 960
   },
-  "start-scene": "e0bea6db-64db-4c3b-b02a-531046201733",
+  "start-scene": "591a1367-313f-4af1-9802-88a6dd1f5ef0",
   "use-customize-simulator": true,
   "use-project-simulator-setting": false
 }

部分文件因为文件数量过多而无法显示