reveal method

  1. @override
Future reveal(
  1. ThermionEntity entity,
  2. String? meshName
)
override

Reveal the node meshName under entity. Only applicable if hide had previously been called; this is a no-op otherwise.

Implementation

@override
Future reveal(ThermionEntity entity, String? meshName) async {
  if (meshName != null) {
    final result = _module.ccall(
        "reveal_mesh",
        "int",
        ["void*".toJS, "int".toJS, "string".toJS].toJS,
        [_sceneManager!, entity.toJS, meshName.toJS].toJS,
        null) as JSNumber;
    if (result.toDartInt == -1) {
      throw Exception(
          "Failed to reveal mesh ${meshName} on entity ${entity.toJS}");
    }
  } else {
    throw Exception(
        "Cannot reveal mesh, meshName must be specified when invoking this method");
  }
}