Require async
This commit is contained in:
+6
-19
@@ -10,24 +10,11 @@ const platformNames = {
|
||||
|
||||
Console.print('Platform: ' + (platformNames[System.platform] || 'Unknown'));
|
||||
|
||||
// Testing async/await
|
||||
async function testAsync() {
|
||||
Console.print('Testing async/await...');
|
||||
await frame();
|
||||
Console.print('First await done!');
|
||||
await timeout(1000);
|
||||
Console.print('Async/await works!');
|
||||
async function testRequireAsync() {
|
||||
Console.print('Loading testscene.js...');
|
||||
const scene = await requireAsync('testscene.js');
|
||||
Console.print('Loaded!');
|
||||
Console.print(scene.test());
|
||||
}
|
||||
|
||||
testAsync();
|
||||
|
||||
// Scene.set('testscene.js');
|
||||
// Console.print('Loading scene...');
|
||||
// requireAsync('./testscene.js', function(scene) {
|
||||
// throw "test";
|
||||
// Console.print('Initializing scene...');
|
||||
// var batch = scene.load();
|
||||
// batch.lock();
|
||||
// batch.requireLoaded();
|
||||
// scene.init();
|
||||
// });
|
||||
testRequireAsync();
|
||||
Reference in New Issue
Block a user