VContainer icon indicating copy to clipboard operation
VContainer copied to clipboard

Root Lifetime Scope Prefab Keeps Showing Up As Modified In Local Git Repo

Open bitbendergames opened this issue 5 months ago • 2 comments

Hello. I created a Project root LifetimeScope following this documentation: https://vcontainer.hadashikick.jp/scoping/project-root-lifetimescope

The issue is that this prefab keeps showing up as modified in my local git repo even though there are no changes.

Expected Result: The project root prefab should not be modified if there are no changes to it.

Actual Result: After modifying a line of code, and the subsequent Unity Editor Domain Reload, the project root prefab shows up as modified.

I'm using Unity: 6000.0.38f1 on Standalone Platform / Windows. VContainer Version: 1.16.9 Git Client: Tortoise Git

bitbendergames avatar Jul 24 '25 11:07 bitbendergames

We had this same issue since we use Perforce for version control.

The problem was that GetOrCreateRootLifetimeScopeInstance sets the prefab GameObject to inactive and then back to its original state after instantiating. I believe it's so it can start out as inactive. Our fix was to set the GameObject as inactive so that it was inactive to start with.

https://github.com/hadashiA/VContainer/blob/0093a457d1abe17bbb97d9c0b7dea921c5e670e4/VContainer/Assets/VContainer/Runtime/Unity/VContainerSettings.cs#L75

Image

mike-odom avatar Sep 25 '25 04:09 mike-odom

https://github.com/hadashiA/VContainer/pull/817 will fix this.

yellowisher avatar Oct 30 '25 01:10 yellowisher