// const randomInt = (min = 0, max = 10) => {
// return (Math.random() * (max - min) + min) | 0;
// };
// const randomColor = () => {
// return new cc.Color(randomInt(0, 255), randomInt(0, 255), randomInt(0, 255));
// };
// const _randomColorObj = randomColor()
const _randomColorObj = new cc.Color( 0, 0, 0);
this.getProfileNode().then((node)=>{
node.scale = 1.5
node.children[0].color = _randomColorObj
node.children[1].color = _randomColorObj
cc.debug.setDisplayStats(false);
})
getProfileNode() {
return new Promise((resolve, reject) => {
let id = setInterval(() => {
let profileNode = cc.find("PROFILER-NODE")
if (profileNode) {
resolve(profileNode);
clearInterval(id);
}
}, 500);
});
},
网友评论