<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>关卡加载 on PlumePHP</title><link>https://plumephp.com/tags/%E5%85%B3%E5%8D%A1%E5%8A%A0%E8%BD%BD/</link><description>Recent content in 关卡加载 on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Thu, 01 Oct 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/tags/%E5%85%B3%E5%8D%A1%E5%8A%A0%E8%BD%BD/index.xml" rel="self" type="application/rss+xml"/><item><title>Defold Collections、Factories 与动态实例化</title><link>https://plumephp.com/defold-collections-factories/</link><pubDate>Thu, 01 Oct 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/defold-collections-factories/</guid><description>&lt;h2 id="引言"&gt;引言&lt;/h2&gt;
&lt;p&gt;Defold 的工作单位是 &lt;strong&gt;Game Object（GO）&lt;/strong&gt;，但实际游戏极少只用一个 GO。几十上百个 GO 怎么组织？答案是 &lt;strong&gt;Collection（集合）&lt;/strong&gt;。Collection 不仅把 GO 打包成层级树，还提供了运行时动态创建的能力——这就是 &lt;strong&gt;Factory（工厂）&lt;/strong&gt;。本文系统讲 Defold Collection 与 Factory：先从 Collection 的层级结构和 .collection 文件讲起，再讲 Factory 组件动态生成单实例、collectionfactory 批量加载整组对象，最后覆盖实例生命周期管理（删除/销毁）、延迟实例化策略，以及如何用 Collection 实现动态关卡加载。&lt;/p&gt;</description></item></channel></rss>