Skip to content

Commit

Permalink
expose rootBone property
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksims committed Dec 16, 2024
1 parent e6a58e5 commit f5ba067
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/framework/components/render/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class RenderComponent extends Component {
* are rendered by this component.
*
* @type {import('../../entity.js').Entity|null}
* @private
*/
_rootBone = null;

Expand Down Expand Up @@ -695,6 +696,11 @@ class RenderComponent extends Component {
this._assetReference.id = id;
}

/**
* Sets the root bone entity (or entity guid) for the render component.
*
* @type {import('../../entity.js').Entity|string|null}
*/
set rootBone(value) {
if (this._rootBone !== value) {
const isString = typeof (value) === 'string';
Expand All @@ -720,6 +726,11 @@ class RenderComponent extends Component {
}
}

/**
* Gets the root bone entity for the render component.
*
* @type {import('../../entity.js').Entity|null}
*/
get rootBone() {
return this._rootBone;
}
Expand Down

0 comments on commit f5ba067

Please sign in to comment.