VContainer-scoping/project-root-lifetimescope | 作用域——项目根作用域 LifetimeScope

可设置全局根作用域作为所有 LifetimeScope 的父级。

    1. 创建根作用域 LifetimeScope 预制体
    1. 创建 VContainerSettings
    • 选择 Assets -> Create -> VContainer -> VContainer Settings
    1. 在 VContainerSettings 的 Inspector 中,将预制体设置到 Root Lifetime Scope 栏位。

:::info
通过该菜单创建的 VContainerSettings 配置文件会自动加入预加载资源(preload assets)。

若遇到 VContainerSettings 配置未加载的情况,请检查Project Settings -> Player中的预加载资源是否包含VContainerSettings。
:::

posted @ 2025-02-18 01:36  凌雪寒  阅读(68)  评论(0)    收藏  举报