Scene script code
This commit is contained in:
+12
-10
@@ -1,6 +1,8 @@
|
||||
var scene = {};
|
||||
var scene = {
|
||||
'test': 'teststring'
|
||||
};
|
||||
|
||||
scene.batch = AssetBatch([
|
||||
var assets = AssetBatch([
|
||||
{ path: 'test.png', type: Asset.TYPE_TEXTURE, format: Texture.FORMAT_RGBA }
|
||||
]);
|
||||
|
||||
@@ -11,12 +13,13 @@ var testPos;
|
||||
var testRenderable;
|
||||
var texEntry;
|
||||
|
||||
scene.load = function() {
|
||||
return scene.batch;
|
||||
scene.init = function() {
|
||||
assets.lock();
|
||||
assets.onLoaded[0] = scene.loaded;
|
||||
};
|
||||
|
||||
scene.init = function() {
|
||||
texEntry = scene.batch.entry(0);
|
||||
scene.loaded = function() {
|
||||
texEntry = assets.entry(0);
|
||||
|
||||
// Camera at (3, 3, 3) looking at origin
|
||||
cam = Entity.create();
|
||||
@@ -35,14 +38,13 @@ scene.init = function() {
|
||||
[0, 0, 1, 1, 0, 1, 1, 0]
|
||||
];
|
||||
testPos.localPosition = new Vec3(0, 0, 0);
|
||||
};
|
||||
}
|
||||
|
||||
scene.dispose = function() {
|
||||
Console.print('Scene Dispose');
|
||||
Entity.dispose(cam);
|
||||
Entity.dispose(testEntity);
|
||||
|
||||
texEntry.unlock();
|
||||
scene.batch.unlock();
|
||||
assets.unlock();
|
||||
};
|
||||
|
||||
module.exports = scene;
|
||||
|
||||
Reference in New Issue
Block a user