//const dragonBones = require('dragonBones'); cc.Class({ extends: cc.Component, properties: { dice: [cc.Node] }, // LIFE-CYCLE CALLBACKS: onLoad () { }, start () { }, update (dt) { }, rollDice(dice) { for (let i = 0; i < this.dice.length; i++) { let diceNode = this.dice[i]; let spine = diceNode.getComponent(dragonBones.ArmatureDisplay); let randomNumber = dice[i]; spine.animationName = "newAnimation" let animationName = "dice" + randomNumber; spine.armatureName = animationName; spine.timeScale = Math.floor(Math.random() * 2) + 1 ; spine.playTimes = 1; console.log(spine.armatureName) } } });