Skip to content

Commit

Permalink
Animation mixin works
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinika committed Aug 4, 2023
1 parent 622de39 commit 42823c2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions modules/client-mobile/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<a-asset-item id="joystick" src="assets/arcade_stick/scene.gltf"></a-asset-item>

<a-mixin id="buttonclick"
animation__buttonup="property: position; from: -1 0.5 -3; to: -1 0.5 -2; startEvents: click, animationcomplete__buttondown; dur: 500"
animation__buttondown="property: position; from: -1 0.5 -2; to: -1 0.5 -3; startEvents: animationcomplete__buttonup; dur: 500"></a-mixin>
animation__buttonup="property: position; from: 0 0 0; to: 0 0 1; startEvents: click; dur: 100"
animation__buttondown="property: position; from: 0 0 1; to: 0 0 0; startEvents: animationcomplete__buttonup; dur: 100"></a-mixin>
</a-assets>

<!-- <a-entity light="type: hemisphere; color: #FFF; intensity: 1" position="0 100 1"></a-entity> -->
Expand All @@ -33,10 +33,11 @@

<!-- <a-circle radius="1" position="-1 0.5 -3" mixin="buttonclick" class="action-button"></a-circle> -->

<a-entity id="mouseCursor" cursor="rayOrigin: mouse" raycaster="objects: #joystick"></a-entity>
<a-entity id="mouseCursor" cursor="rayOrigin: mouse" raycaster="objects: #box"></a-entity>

<!-- <a-sphere id="box" material="color: red" position="-1 0.5 -3" rotation="0 30 0" mixin="buttonclick"> -->
</a-sphere>
<a-entity material="color: red" position="-1 0.5 -3" rotation="0 30 0">
<a-entity id="box" mixin="buttonclick" geometry="primitive: sphere" color="blue"></a-entity>
</a-entity>
</a-scene>


Expand Down

0 comments on commit 42823c2

Please sign in to comment.