You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even if autorun is set to false in Awake, GetRuntimeParent is called and the Parent is set.
This is not convenient in the following situations
// With VContainerSettings.Instance.RootLifetimeScope set.
// Assuming the autorun of the LifetimeScope Prefab for this key's address is set to false
var handle = await Addressables.LoadAssetAsync<LifetimeScope>(key);
var result = handle.Result;
// Internal Awake sets Parent to VContainerSettings.Instance.RootLifetimeScope
var instance = Instantiate(assetLoadHandle.Result);
// I call Build with parentScope as parent at another time, but it doesn't work as intended because Parent is already set
using (LifetimeScope.EnqueueParent(parentScope)) {
instance.Build();
}
I think it would be better if the Parent is determined at Build time, since the Parent resolution process is also performed inside Build, so I think it would be better to remove the GetRuntimeParent that is called in Awake.
The text was updated successfully, but these errors were encountered:
You may be right.
I've decided to remove the GetRuntimeParent call. #726
If autoRun = true, it shouldn't have any effect, so it should probably be fine.
Thanks for your help.
VContainer: v1.16.4
Even if autorun is set to false in Awake, GetRuntimeParent is called and the Parent is set.
This is not convenient in the following situations
I think it would be better if the Parent is determined at Build time, since the Parent resolution process is also performed inside Build, so I think it would be better to remove the GetRuntimeParent that is called in Awake.
The text was updated successfully, but these errors were encountered: