![Unity中默认的自动切换壁纸是怎么实现的?(15.10)](https://linux22.com/image/877236/Unity%E4%B8%AD%E9%BB%98%E8%AE%A4%E7%9A%84%E8%87%AA%E5%8A%A8%E5%88%87%E6%8D%A2%E5%A3%81%E7%BA%B8%E6%98%AF%E6%80%8E%E4%B9%88%E5%AE%9E%E7%8E%B0%E7%9A%84%EF%BC%9F%EF%BC%8815.10%EF%BC%89.png)
大家都知道,当您转到System Settings>Appearance并查看可用的背景图像时,它看起来像下面的屏幕截图:
第三个背景图标上有一个时钟符号,选择它将导致壁纸每次更改[?]分钟并循环浏览所有默认背景。
现在我的问题是这是如何制作的。我知道有几种外部程序可以自动切换壁纸,甚至编写脚本也不难。但我感兴趣的是这个特定的 Unity 功能是如何实现的,以及如何自定义这个自动壁纸切换器,例如使用其他图像或不同的延迟时间。
暗示:
/usr/share/backgrounds/contest/wily.xml
我找到了似乎与壁纸更改魔法有关的文件。但我仍然不知道它究竟是如何工作的,它是否可以处理更多文件,语法如何以及它支持哪些内容等。
以下是其内容的转储:
<background>
<starttime>
<year>2009</year>
<month>08</month>
<day>04</day>
<hour>00</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at midnight. -->
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Tramonto_a_Scalea_by_Renatvs88.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Tramonto_a_Scalea_by_Renatvs88.jpg</from>
<to>/usr/share/backgrounds/Tranquil_by_Pat_David.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Tranquil_by_Pat_David.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Tranquil_by_Pat_David.jpg</from>
<to>/usr/share/backgrounds/Light_my_fire_evening_sun_by_Dariusz_Duma.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Light_my_fire_evening_sun_by_Dariusz_Duma.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Light_my_fire_evening_sun_by_Dariusz_Duma.jpg</from>
<to>/usr/share/backgrounds/Sitting_Here,_Making_Fun_by_Philipp_Haegi.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Sitting_Here,_Making_Fun_by_Philipp_Haegi.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Sitting_Here,_Making_Fun_by_Philipp_Haegi.jpg</from>
<to>/usr/share/backgrounds/Moss_inflorescence_by_carmelo75.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Moss_inflorescence_by_carmelo75.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Moss_inflorescence_by_carmelo75.jpg</from>
<to>/usr/share/backgrounds/Breaker_by_Lyle_Nel.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Breaker_by_Lyle_Nel.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Breaker_by_Lyle_Nel.jpg</from>
<to>/usr/share/backgrounds/Blue_by_dariuskws.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Blue_by_dariuskws.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Blue_by_dariuskws.jpg</from>
<to>/usr/share/backgrounds/Hotel_by_sarcasmrules2011.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Hotel_by_sarcasmrules2011.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Hotel_by_sarcasmrules2011.jpg</from>
<to>/usr/share/backgrounds/Mediterranean_Sea_by_simosx.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Mediterranean_Sea_by_simosx.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Mediterranean_Sea_by_simosx.jpg</from>
<to>/usr/share/backgrounds/Abstract_Ubuntu_by_Marek_Koteluk.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Abstract_Ubuntu_by_Marek_Koteluk.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Abstract_Ubuntu_by_Marek_Koteluk.jpg</from>
<to>/usr/share/backgrounds/Tramonto_a_Scalea_by_Renatvs88.jpg</to>
</transition>
</background>