Ensure storage exists
This commit is contained in:
parent
c6de00dc60
commit
ea21439d9f
|
@ -18,6 +18,9 @@ void main() {
|
|||
|
||||
gl_Position = vec4(pos.xy, 0.0, 1.0);
|
||||
|
||||
// fullscreen triangle: http://de.slideshare.net/DevCentralAMD/vertex-shader-tricks-bill-bilodeau
|
||||
// gl_Position = vec4((gl_VertexID % 2) * 4.0 - 1.0, (gl_VertexID / 2) * 4.0 - 1.0, 0.0, 1.0);
|
||||
|
||||
// NDC (at the back of cube)
|
||||
vec4 v = vec4(pos.x, pos.y, 1.0, 1.0);
|
||||
v = vec4(invVP * v);
|
||||
|
|
|
@ -10,6 +10,8 @@ class ReadStorageNode extends LogicNode {
|
|||
var key:String = inputs[0].get();
|
||||
|
||||
var data:Dynamic = iron.system.Storage.data;
|
||||
if (data == null) return null;
|
||||
|
||||
var value:Dynamic = Reflect.field(data, key);
|
||||
|
||||
if (value == null) {
|
||||
|
|
|
@ -11,6 +11,8 @@ class WriteStorageNode extends LogicNode {
|
|||
var value:Dynamic = inputs[2].get();
|
||||
|
||||
var data = iron.system.Storage.data;
|
||||
if (data == null) return;
|
||||
|
||||
Reflect.setField(data, key, value);
|
||||
iron.system.Storage.save();
|
||||
|
||||
|
|
Loading…
Reference in a new issue