Skip to content

Commit

Permalink
Fix visible component
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvergenz committed Nov 14, 2017
1 parent 4e5813a commit 70fd2d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions dist/altspace.js
Expand Up @@ -3017,6 +3017,9 @@ var Visible = (function (AFrameComponent$$1) {
var prototypeAccessors = { schema: {} };

prototypeAccessors.schema.get = function (){ return {default: true}; };
Visible.prototype.init = function init (){
this.el.addEventListener('model-loaded', this.update.bind(this));
};
Visible.prototype.update = function update (){
var this$1 = this;

Expand Down
8 changes: 4 additions & 4 deletions dist/altspace.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/aframe/model-repos.html
Expand Up @@ -16,7 +16,7 @@
data-attribution='https://www.remix3d.com/details/G009SXJCMDL3'></a-asset-item>
</a-assets>

<a-entity id='moon' position='0 -.77 .05' gltf-model='#moon'></a-entity>
<a-entity id='moon' visible=false position='0 -.77 .05' gltf-model='#moon' visible='false' ></a-entity>
<a-entity id='bear' scale='2.5 2.5 2.5' gltf-model='#bear'></a-entity>
</a-scene>
</body>
Expand Down
3 changes: 3 additions & 0 deletions src/components/visible.js
Expand Up @@ -4,6 +4,9 @@ delete AFRAME.components['visible'];

export default class Visible extends AFrameComponent {
get schema(){ return {default: true}; }
init(){
this.el.addEventListener('model-loaded', this.update.bind(this));
}
update(){
this.el.object3D.traverse(obj => obj.visible = this.data);
}
Expand Down

0 comments on commit 70fd2d5

Please sign in to comment.