Animation A帧通过事件组件触发元素动画&;代理组件

Animation A帧通过事件组件触发元素动画&;代理组件,animation,aframe,webvr,Animation,Aframe,Webvr,我试图在查看某个元素时触发其他元素上的动画。因此,我试图实现的是:当我将球悬停时,文本应该淡入。当我离开球的时候,文字会淡出 我被告知这应该可以通过aframe proxy event组件实现,但我找不到任何关于如何使用此组件的示例或文档 代码如下所示: <script src="https://unpkg.com/aframe-animation-component@5.1.2/dist/aframe-animation-component.min.js"></script&

我试图在查看某个元素时触发其他元素上的动画。因此,我试图实现的是:当我将球悬停时,文本应该淡入。当我离开球的时候,文字会淡出

我被告知这应该可以通过
aframe proxy event组件实现,但我找不到任何关于如何使用此组件的示例或文档

代码如下所示:

<script src="https://unpkg.com/aframe-animation-component@5.1.2/dist/aframe-animation-component.min.js"></script>
<script src="https://unpkg.com/aframe-event-set-component@4.0.0/dist/aframe-event-set-component.min.js"></script>
<script src="https://unpkg.com/aframe-proxy-event-component/dist/aframe-proxy-event-component.min.js"></script>

<a-mixin id="scaleUpMixin" animation__scale="property: scale; dur: 500; easing: easeInOutQuad; to: 1.5 1.5 1.5;"></a-mixin>
<a-mixin id="scaleDownMixin" animation__scale2="property: scale; dur: 500; easing: easeInOutQuad; to: 1 1 1;"></a-mixin>

<a-mixin id="fadeInText" animation__opacity="property: text.opacity; dur: 500; to: 1"></a-mixin>
<a-mixin id="fadeOutText" animation__opacity2="property: text.opacity; dur: 500; to: 0"></a-mixin>

<a-entity rotation="0 -10 0">
    <!-- Planet -->
    <a-sphere color="yellow" position="0 1.8 -5" radius="0.5" scale="1 1 1" 
        mixin="scaleUpMixin scaleDownMixin"
        animation__scale="startEvents: mouseenter;"
        animation__scale2="startEvents: mouseleave;">
    </a-sphere>

    <!-- Text -->
    <a-text id="TextMercury" class="textbox" text="value: Merkur; align: center; color:#FFF" opacity="0" scale="0.8 0.8 0.8"
        position="0 1.8 -1"> </a-text>

</a-entity>

代码中的一个示例:


谢谢

您需要将
代理事件
组件附加到球体。它有很好的文档记录(有一个例子)@

如果您有一个按钮,您可以重定向如下任何事件:

<a-box proxy-event="event: event; to: targetSelector; as: newname"></a-box>
<a-entity animation="(...) startEvents: newname"></a-entity>

您需要将
代理事件
组件附加到球体。它有很好的文档记录(有一个例子)@

如果您有一个按钮,您可以重定向如下任何事件:

<a-box proxy-event="event: event; to: targetSelector; as: newname"></a-box>
<a-entity animation="(...) startEvents: newname"></a-entity>

非常感谢您!非常感谢你!