Created
November 19, 2018 06:33
-
-
Save madclaws/1d0faab86095df1cf66c89106b9374fa to your computer and use it in GitHub Desktop.
assetLoader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private loadAssets(){ | |
console.log("loading assets"); | |
this._assetManager=new AssetsManager(this._Scene); | |
let meshTask=this._assetManager.addMeshTask("gemTask","Skull","Assets/","Skull.obj"); | |
meshTask.onSuccess=(task:MeshAssetTask)=>{ | |
console.log("load success"); | |
console.log(task); | |
task.loadedMeshes[0].position=Vector3.Zero(); | |
} | |
meshTask.onError=(task,message,exception)=>{ | |
console.log(message,exception); | |
} | |
this._assetManager.onFinish=(tasks)=>{ | |
console.log("loading finished"); | |
this.runEngine(); | |
} | |
this._assetManager.onProgress = (remainingCount, totalCount, lastFinishedTask)=>{ | |
this._Engine.loadingUIText = 'We are loading the scene. ' + remainingCount + ' out of ' + totalCount + ' items still need to be loaded.'; | |
}; | |
this._assetManager.load(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment