armory/Sources/armory/logicnode/MeshNode.hx

30 lines
523 B
Haxe
Raw Permalink Normal View History

2017-04-11 11:28:22 +02:00
package armory.logicnode;
2017-11-20 15:16:52 +01:00
import iron.data.MeshData;
2017-04-11 11:28:22 +02:00
class MeshNode extends LogicNode {
2019-12-19 23:54:08 +01:00
public var property0: String;
public var value: MeshData = null;
2017-04-11 11:28:22 +02:00
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree) {
2017-04-11 11:28:22 +02:00
super(tree);
2017-11-20 15:16:52 +01:00
iron.Scene.active.notifyOnInit(function() {
2017-04-11 11:28:22 +02:00
get(0);
});
}
2019-12-19 23:54:08 +01:00
override function get(from: Int): Dynamic {
iron.data.Data.getMesh("mesh_" + property0, property0, function(mesh: MeshData) {
2017-04-11 11:28:22 +02:00
value = mesh;
});
return value;
}
2019-12-19 23:54:08 +01:00
override function set(value: Dynamic) {
2017-04-11 11:28:22 +02:00
this.value = value;
}
}