armory/Sources/armory/logicnode/GetObjectTraitsNode.hx
E1e5en ef4dbd7611 LN for Traits
1. Modification of CanvasScript and WasmScript classes: added a field to save the name of the script / file in the class.
2. Added logical nodes for working with Traits.
- Get Object Traits - gets an array of Traits for the specified object;
- Get Trait Name - get the Trait name (the name that appears in the list in Armory Traits) and its type (Canvas, Wasm, Bundle, LogicNode or Haxe).
2020-10-24 22:04:47 +03:00

17 lines
310 B
Haxe

package armory.logicnode;
import iron.object.Object;
class GetObjectTraitsNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var object: Object = inputs[0].get();
if (object == null) return null;
return object.traits;
}
}