File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
VContainer/Assets/VContainer/Runtime/Unity Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -71,15 +71,18 @@ public LifetimeScope GetOrCreateRootLifetimeScopeInstance()
7171 {
7272 if ( RootLifetimeScope != null && rootLifetimeScopeInstance == null )
7373 {
74- var activeBefore = RootLifetimeScope . gameObject . activeSelf ;
75- RootLifetimeScope . gameObject . SetActive ( false ) ;
74+ using ( new ObjectResolverUnityExtensions . PrefabDirtyScope ( RootLifetimeScope . gameObject ) )
75+ {
76+ var activeBefore = RootLifetimeScope . gameObject . activeSelf ;
77+ RootLifetimeScope . gameObject . SetActive ( false ) ;
7678
77- rootLifetimeScopeInstance = Instantiate ( RootLifetimeScope ) ;
78- SetName ( rootLifetimeScopeInstance , RootLifetimeScope ) ;
79- DontDestroyOnLoad ( rootLifetimeScopeInstance ) ;
80- rootLifetimeScopeInstance . gameObject . SetActive ( true ) ;
79+ rootLifetimeScopeInstance = Instantiate ( RootLifetimeScope ) ;
80+ SetName ( rootLifetimeScopeInstance , RootLifetimeScope ) ;
81+ DontDestroyOnLoad ( rootLifetimeScopeInstance ) ;
82+ rootLifetimeScopeInstance . gameObject . SetActive ( true ) ;
8183
82- RootLifetimeScope . gameObject . SetActive ( activeBefore ) ;
84+ RootLifetimeScope . gameObject . SetActive ( activeBefore ) ;
85+ }
8386 }
8487 return rootLifetimeScopeInstance ;
8588 }
You can’t perform that action at this time.
0 commit comments