VContainer-scoping/project-root-lifetimescope | 作用域——项目根作用域 LifetimeScope
可设置全局根作用域作为所有 LifetimeScope 的父级。
-
- 创建根作用域 LifetimeScope 预制体
-
- 创建
VContainerSettings
- 选择
Assets -> Create -> VContainer -> VContainer Settings
- 创建
-
- 在 VContainerSettings 的 Inspector 中,将预制体设置到 Root Lifetime Scope 栏位。

:::info
通过该菜单创建的 VContainerSettings 配置文件会自动加入预加载资源(preload assets)。
若遇到 VContainerSettings 配置未加载的情况,请检查Project Settings -> Player中的预加载资源是否包含VContainerSettings。
:::

浙公网安备 33010602011771号