addCollisionComponent method
Future
addCollisionComponent(
- ThermionEntity entity, {
- void callback()?,
- bool affectsTransform = false,
override
Implementation
@override
Future addCollisionComponent(ThermionEntity entity,
{void Function(int entityId1, int entityId2)? callback,
bool affectsTransform = false}) async {
if (_sceneManager == null) {
throw Exception("SceneManager must be non-null");
}
// ignore: sdk_version_since
if (callback != null) {
var ptr =
NativeCallable<Void Function(Int entityId1, Int entityId2)>.listener(
callback);
add_collision_component(
_sceneManager!, entity, ptr.nativeFunction, affectsTransform);
_collisions[entity] = ptr;
} else {
add_collision_component(
_sceneManager!, entity, nullptr, affectsTransform);
}
}