forked from LeenkxTeam/LNXSDK
moisesjpelaez - Physics Private Fields
This commit is contained in:
@ -1,38 +1,38 @@
|
|||||||
package leenkx.logicnode;
|
package leenkx.logicnode;
|
||||||
|
|
||||||
import iron.object.Object;
|
import iron.object.Object;
|
||||||
|
|
||||||
class GetParticleNode extends LogicNode {
|
class GetParticleNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree: LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from: Int): Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object: Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
#if lnx_particles
|
#if lnx_particles
|
||||||
|
|
||||||
var mo = cast(object, iron.object.MeshObject);
|
var mo = cast(object, iron.object.MeshObject);
|
||||||
|
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case 0:
|
case 0:
|
||||||
var names: Array<String> = [];
|
var names: Array<String> = [];
|
||||||
if (mo.particleSystems != null)
|
if (mo.particleSystems != null)
|
||||||
for (psys in mo.particleSystems)
|
for (psys in mo.particleSystems)
|
||||||
names.push(psys.r.name);
|
names.push(@:privateAccess psys.r.name);
|
||||||
return names;
|
return names;
|
||||||
case 1:
|
case 1:
|
||||||
return mo.particleSystems != null ? mo.particleSystems.length : 0;
|
return mo.particleSystems != null ? mo.particleSystems.length : 0;
|
||||||
case 2:
|
case 2:
|
||||||
return mo.render_emitter;
|
return mo.render_emitter;
|
||||||
default:
|
default:
|
||||||
null;
|
null;
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user