getChildEntity method

  1. @override
Future<ThermionEntity> getChildEntity(
  1. ThermionEntity parent,
  2. String childName
)
override

Implementation

@override
Future<ThermionEntity> getChildEntity(
    ThermionEntity parent, String childName) async {
  var childNamePtr =
      childName.toNativeUtf8(allocator: allocator).cast<Char>();

  var childEntity =
      find_child_entity_by_name(_sceneManager!, parent, childNamePtr);
  allocator.free(childNamePtr);
  if (childEntity == _FILAMENT_ASSET_ERROR) {
    throw Exception(
        "Could not find child ${childName} under the specified entity");
  }
  return childEntity;
}