creator 2.0怎么获取一个范围的随机数。

如题,想要让图片的角度随机变化,在官方文档中 Editor.Math.randomRangeInt(min, max)
rotationRandom(){
this.node.angle = Editor.Math.randomRangeInt(0,360);
cc.log(this.node.angle);
},
编译的时候就报错:Editor is not defined!
请问各位大神,这个什么原因呀。

Math.random()*360

那这个Editor 该怎么去使用呢

//生成从minNum到maxNum的随机数 function randomNum(minNum,maxNum){ switch(arguments.length){ case 1: return parseInt(Math.random()*minNum+1,10); break; case 2: return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); break; default: return 0; break; } }