* @zh 设置实体为持久化(跨场景保留) * @en Mark entity as persistent (survives scene transitions) * * @zh 标记后的实体在场景切换时不会被销毁,会自动迁移到新场景 * @en Persistent entities are automatically migrated to the new scene * * @returns @zh this,支持链式调用 @en Returns this for chaining * * @example
()
| 223 | * ``` |
| 224 | */ |
| 225 | public setPersistent(): this { |
| 226 | this._lifecyclePolicy = EEntityLifecyclePolicy.Persistent; |
| 227 | return this; |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * @zh 设置实体为场景本地(随场景销毁),恢复默认行为 |
no outgoing calls
no test coverage detected