Browse Source

修改逻辑

lan 3 years ago
parent
commit
e503cfb53a
1 changed files with 6 additions and 1 deletions
  1. 6 1
      assets/script/rule/DragRule.ts

+ 6 - 1
assets/script/rule/DragRule.ts

@@ -134,7 +134,12 @@ export default class DragRule extends BaseRule {
         let endRule: DragRule = this.endNode.getComponent(DragRule)
         let curValue = this.value
         if (this.coupleHide) curValue = this.containValue
-        let isValid = endRule.containValue.search(curValue) != -1 && endRule.containValue != '-1'
+
+        let isValid = false
+        if (endRule.containValue != '-1') {
+            let tempArr = endRule.containValue.split(',')
+            isValid = tempArr.filter(value1 => value1 == this.value).length > 0
+        }
         // 返回结果
         let result: IRuleResult = {fo: this.node, to: this.endNode, isValid: isValid}
         if (isValid) {