【发布时间】:2019-09-06 03:45:24
【问题描述】:
构建 iPhone 局部全景图之旅。 其中大约有 40 多个,而且移动设备上的内存似乎快用完了。
此外,使用版本 A-frame 0.5.0,下面的代码可以在桌面上运行,但不能在最新版本 0.9.2 中运行。
<a-entity id="pano_01" visible="true">
<a-curvedimage asset-on-demand="src: ../Html_Templates/pix/Upgrade.jpg" height="145" radius="100" theta-length="300" rotation="0 33 0"></a-curvedimage>
<a-sky asset-on-demand="src: ../Html_Templates/pix/Upgrade_sky.jpg" rotation="0 -90 0"></a-sky>
<a-image asset-on-demand="src: ../Html_Templates/pix/UI_Next.png" position="0 -0.5 -3" scale="0.35 0.35 0.35" onclick="setpano_02()"></a-image>
</a-entity>
<a-entity id="pano_02" visible="false">
<a-sky asset-on-demand="src: ../Html_Templates/pix/JRO_Arrive_sky.jpg"></a-sky>
<a-curvedimage asset-on-demand="src: ../Html_Templates/pix/JRO_Arrive.jpg" height="140" radius="100.0" theta-length="300" rotation="0 60 0"></a-curvedimage>
<a-image asset-on-demand="src: ../Html_Templates/pix/UI_Next.png" position="1 -0.5 -3" scale="0.35 0.35 0.35" onclick="setpano_03()"></a-image>
<a-image asset-on-demand="src: ../Html_Templates/pix/UI_Back.png" position="-1 -0.5 -3" scale="0.35 0.35 0.35" onclick="setpano_01()"></a-image>
</a-entity>
支持上述的Java:
function setpano_01() {
document.getElementById('pano_01').setAttribute('visible', 'true')
document.getElementById('pano_02').setAttribute('visible', 'false')
}
function setpano_02() {
document.getElementById('pano_01').setAttribute('visible', 'false')
document.getElementById('pano_02').setAttribute('visible', 'true')
document.getElementById('pano_03').setAttribute('visible', 'false')
我的期望是按需资产脚本将有助于释放内存资源,但它似乎不适用于此策略。 另外,我希望最新版本的 A-Frame 能够改进内存管理。
(我希望这个问题现在措辞更好)。
【问题讨论】:
-
请阅读How to Ask,然后阅读edit您的问题。照原样,您的问题可能过于广泛。此外,“不起作用”不是有用的问题描述。请将您的代码添加为minimal reproducible example。当你运行它时会发生什么?你期望会发生什么?有什么错误吗?