Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,36 @@
package leenkx.logicnode;
import iron.object.MeshObject;
import iron.object.DecalObject;
class GetMaterialNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var object = inputs[0].get();
assert(Error, object != null, "The object input must not be null");
#if rp_decals
if (Std.isOfType(object, DecalObject)) {
var decal = cast(object, DecalObject);
return decal.material;
}
#end
if (Std.isOfType(object, MeshObject)) {
var mesh = cast(object, MeshObject);
var slot: Int = inputs[1].get();
if (mesh == null) return null;
return mesh.materials[slot];
}
return null;
}
}