فهرست منبع

Merge branch 'master' of http://zhi-edu.com:3000/lan/zedu_client

# Conflicts:
#	assets/scene/Editor.fire
Administrator 3 سال پیش
والد
کامیت
ba91149ec0
2فایلهای تغییر یافته به همراه14 افزوده شده و 8 حذف شده
  1. 1 0
      assets/script/enums/Enum.ts
  2. 13 8
      assets/script/rule/GuideRule.ts

+ 1 - 0
assets/script/enums/Enum.ts

@@ -136,6 +136,7 @@ export enum ACT_TYPE {
     moveBy,
     fadeIn,
     fadeOut,
+    blink,
     fadeTo,
     rotateTo,
     rotateBy,

+ 13 - 8
assets/script/rule/GuideRule.ts

@@ -12,6 +12,7 @@ enum ActionChineseType {
     移动相对,
     渐显,
     渐隐,
+    闪烁,
     透明至,
     旋转,
     旋转相对,
@@ -79,7 +80,7 @@ class CustomAction {
         displayName: '透明度(0-255)',
         range: [0, 255, 1],
         visible() {
-            return this.actionType == ACT_TYPE.fadeTo
+            return this.actionType == ACT_TYPE.fadeTo || this.actionType == ACT_TYPE.blink
         },
     })
     opacity: number = 0
@@ -198,13 +199,13 @@ export default class GuideRule extends cc.Component {
         node.name = data.nodeName
         node.opacity = 255
         node.angle = 0
-        if (data.scale) node.scale = data.scale
-        if (data.scaleX) node.scaleX = data.scaleX
-        if (data.scaleY) node.scaleY = data.scaleY
-        if (data.angle) node.angle = data.angle
-        if (data.anchorX) node.anchorX = data.anchorX
-        if (data.anchorY) node.anchorY = data.anchorY
-        if (data.opacity) node.opacity = data.opacity
+        if (data.scale != undefined) node.scale = data.scale
+        if (data.scaleX != undefined) node.scaleX = data.scaleX
+        if (data.scaleY != undefined) node.scaleY = data.scaleY
+        if (data.angle != undefined) node.angle = data.angle
+        if (data.anchorX != undefined) node.anchorX = data.anchorX
+        if (data.anchorY != undefined) node.anchorY = data.anchorY
+        if (data.opacity != undefined) node.opacity = data.opacity
     }
     getCustomAudioObj(data) {
         let audios = []
@@ -264,6 +265,10 @@ export default class GuideRule extends cc.Component {
                             actionTween.to(customAction.runTime, {opacity: 255})
                         } else if (customAction.actionType == ACT_TYPE.fadeOut) {
                             actionTween.to(customAction.runTime, {opacity: 0})
+                        } else if (customAction.actionType == ACT_TYPE.blink) {
+                            actionTween
+                                .to(customAction.runTime / 2, {opacity: customAction.opacity})
+                                .to(customAction.runTime / 2, {opacity: 255})
                         } else if (customAction.actionType == ACT_TYPE.moveTo) {
                             actionTween.to(customAction.runTime, {x: customAction.pos.x, y: customAction.pos.y})
                         } else if (customAction.actionType == ACT_TYPE.moveBy) {