Commit 21984688 authored by 范雪寒's avatar 范雪寒

refrector: for改foreach

parent 2b12ba15
...@@ -63,12 +63,19 @@ export class MyGame extends Game { ...@@ -63,12 +63,19 @@ export class MyGame extends Game {
} }
preLoadData(imgUrlList, audioUrlList) { preLoadData(imgUrlList, audioUrlList) {
for (var i = 0; i < imgUrlList.length; ++i) { imgUrlList.forEach((data) => {
this._parent.addUrlToImages(imgUrlList[i]); this._parent.addUrlToImages(data)
} });
for (var i = 0; i < audioUrlList.length; ++i) { audioUrlList.forEach((data) => {
this._parent.addUrlToAudioObj(audioUrlList[i]); this._parent.addUrlToAudioObj(data);
} });
// for (var i = 0; i < imgUrlList.length; ++i) {
// this._parent.addUrlToImages(imgUrlList[i]);
// }
// for (var i = 0; i < audioUrlList.length; ++i) {
// this._parent.addUrlToAudioObj(audioUrlList[i]);
// }
} }
initView() { initView() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment