用户:
Henry_嘟查看:1 回复:1 评论:1 创建时间:2022-03-21T10:17:23
let names=[ {na:"-1",as:[89.6 , 12.1 , 73.7],us:[98 , 12.1 , 73.7]}, {na:"-2",as:[58.1 , 10.2 , 53],us:[58.1 , 25.9 , 53]}, ]
let elevator let endPos let startPos let ani for (const eq of names) { //遍历names中的每一个元素 elevator = world.querySelector('#滑板1'+eq.na) //获取电梯板实体 endPos = eq.as//电梯的最高位置/// startPos = eq.us//电梯的最低位置///!!! ani = elevator.animate([// 1+5+1+2=9, 总时间15秒被切成9份 { position: startPos, duration: 3 },// 1/9 的时间停留在地面 { position: startPos, duration: 4 },// 5/9 的时间用于地面往楼顶移动 { position: endPos, duration: 1 },// 1/9 的时间停留在楼顶 { position: endPos, duration: 1 },// 2/9 的时间从楼顶回到地面 ])
ani.play({ duration: 16 * 5, //播放一个循环共用时15秒(每秒16帧), iterations: Infinity,//动画无限次循环播放 direction: Box3AnimationDirection.WRAP,//让动画实体从终点回到起点 }) } 报错是这样的:
