getChildEntityNames method
Future<List<String> >
getChildEntityNames(
- ThermionEntity entity, {
- bool renderableOnly = true,
override
List the name of all child entities under the given entity.
Implementation
@override
Future<List<String>> getChildEntityNames(ThermionEntity entity,
{bool renderableOnly = true}) async {
var entityCountJS = _module.ccall(
"get_entity_count",
"int",
["void*".toJS, "int".toJS, "bool".toJS].toJS,
[_sceneManager!, entity.toJS, renderableOnly.toJS].toJS,
null) as JSNumber;
var entityCount = entityCountJS.toDartInt;
var names = <String>[];
for (int i = 0; i < entityCount; i++) {
var namePtr = _module.ccall(
"get_entity_name_at",
"char*",
["void*".toJS, "int".toJS, "int".toJS, "bool".toJS].toJS,
[_sceneManager!, entity.toJS, i.toJS, renderableOnly.toJS].toJS,
null) as JSNumber;
names.add(_module.UTF8ToString(namePtr).toDart);
}
return names;
}