Fix some script bugs
This commit is contained in:
+13
-13
@@ -1,8 +1,8 @@
|
||||
var scene = {};
|
||||
|
||||
// var assets = AssetBatch([
|
||||
// { path: 'test.png', type: Asset.TYPE_TEXTURE, format: Texture.FORMAT_RGBA }
|
||||
// ]);
|
||||
var assets = AssetBatch([
|
||||
{ path: 'test.png', type: Asset.TYPE_TEXTURE, format: Texture.FORMAT_RGBA }
|
||||
]);
|
||||
|
||||
var cam;
|
||||
var camPos;
|
||||
@@ -11,12 +11,12 @@ var testPos;
|
||||
var testRenderable;
|
||||
var texEntry;
|
||||
|
||||
scene.init = function() {
|
||||
// assets.lock();
|
||||
// await assets.loaded();
|
||||
scene.init = async function() {
|
||||
assets.lock();
|
||||
await assets.loaded();
|
||||
|
||||
Console.print('Scene Init');
|
||||
// texEntry = assets.entry(0);
|
||||
texEntry = assets.entry(0);
|
||||
|
||||
// Camera at (3, 3, 3) looking at origin
|
||||
cam = Entity.create();
|
||||
@@ -30,11 +30,11 @@ scene.init = function() {
|
||||
testPos = testEntity.add(Component.POSITION);
|
||||
testRenderable = testEntity.add(Component.RENDERABLE);
|
||||
|
||||
// testRenderable.texture = texEntry.texture;
|
||||
// testRenderable.type = Renderable.SPRITEBATCH;
|
||||
// testRenderable.sprites = [
|
||||
// [0, 0, 1, 1, 0, 1, 1, 0]
|
||||
// ];
|
||||
testRenderable.texture = texEntry.texture;
|
||||
testRenderable.type = Renderable.SPRITEBATCH;
|
||||
testRenderable.sprites = [
|
||||
[0, 0, 1, 1, 0, 1, 1, 0]
|
||||
];
|
||||
// testPos.localPosition = new Vec3(0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ scene.dispose = function() {
|
||||
Console.print('Scene Dispose');
|
||||
Entity.dispose(cam);
|
||||
Entity.dispose(testEntity);
|
||||
// assets.unlock();
|
||||
assets.unlock();
|
||||
};
|
||||
|
||||
module.exports = scene;
|
||||
|
||||
Reference in New Issue
Block a user