let count1 = 1;
Laya.timer.loop(3000, this, function () {
sp.graphics.clear();
if (count1 == 0) {
sp.graphics.drawLines(0, 0, path, "#0eff00", 5);
} else if (count1 == 1) {
sp.graphics.drawLines(0, 0, path1, "#0eff00", 5);
} else if (count1 == 2) {
sp.graphics.drawLines(0, 0, path2, "#0eff00", 5);
} else if (count1 == 3) {
sp.graphics.drawLines(0, 0, path3, "#0eff00", 5);
count1 = -1;
}
console.log(count1);
count1++;
});
上面的sp.graphics.clear()不起作用