JS_0044:随机生成0到x,x到y 的随机数,float插值,坐标插值

1,

Math.floor(Math.random() *X); //随机0到x的数
Math.floor(Math.random() *(Y-X)) + X; //随机x到y之间的数

2,

this.posX = pc.math.lerp(this.posX,this.endPos.x, time); //float进行lerp
this.startPos.lerp(this.startPos,this.endPos,time);//坐标lerp
琥珀君的博客
原文地址:https://www.cnblogs.com/eliteboy/p/14309618.html