Skip to content

Commit

Permalink
ModelLibraryInstance : Added setParent method
Browse files Browse the repository at this point in the history
  • Loading branch information
TothBenoit committed Nov 27, 2024
1 parent a05f6ca commit deec31e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hrt/prefab/l3d/ModelLibrary.hx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ class ModelLibraryInstance {
return @:privateAccess new MeshEmitter(this, batches, materials, mesh);
}

public function setParent( parent : h3d.scene.Object ) {
for ( b in batchCache ) {
if ( b.parent != null )
@:privateAccess b.parent.children.remove(b);
if ( parent != null )
parent.addChild(b);
}
}

public function remove() {
for ( b in batchCache )
b.remove();
Expand Down

0 comments on commit deec31e

Please sign in to comment.