In SBP 1.7.0 you added this:
- Added [VersionedCallback] attribute for flagging build impacting changes to IProcessScene, IProcessSceneWithReport, IPreprocessShaders, and IPreprocessComputeShaders callbacks.
This is probably meant to fix the issues I reported earlier:
- (Case 1297713) Addressables doesn’t create proper build when “Scene Postprocessor” changed ( forum post )
- (Case 1321433) Addressables/SBP don’t detect IPreprocessShaders changes ( forum post )
Unfortunately, the way this is implemented doesn’t fix the issue for me. The problem is that you implemented versioning per type, but I need this per object instance. I need this just like it’s found in AssetPostprocessor.GetVersion, which I assumed would be how you’re going to implement it in SBP too.
Please let me explain why [VersionedCallback] isn’t solving the problem.
My “Scene Processing Pipeline” is stored in a ScriptableObject asset, it looks like this in the Inspector:
Each of these “Components” performs a specific task, for example removing GameObjects with a specific tag. Rather than coding the “scene processing”, you have a few “lego bricks” that you can mix&match to what you need to perform.
The actual IProcessSceneWithReport implementation just runs the asset and it looks like this:
[VersionedCallback(1)]
class MyCustomBuildProcessor : IProcessSceneWithReport
{
public int callbackOrder
{
get { return 0; }
}
public void OnProcessScene(UnityEngine.SceneManagement.Scene scene, BuildReport report)
{
var context = SceneProcessingPipeline.Begin("testasset");
try
{
SceneProcessingPipeline.ProcessScene(context, scene);
}
finally
{
SceneProcessingPipeline.End(context);
}
}
}
As you already imagine, changing the Scene Processing Pipeline Asset does not rebuild scenes, because changing the asset content does not cause the VersionedCallback attribute version to change.
Instead of specifying the version on the type, I need to be able return the version of the IProcessSceneWithReport object instance. For example like this:
class MyCustomBuildProcessor : IProcessSceneWithReport
{
public int callbackOrder
{
get { return 0; }
}
public uint GetVersion()
{
// return hash of asset to return a different version each time the content changed
get { return HashOfAssetArtifact(); }
}
public void OnProcessScene(UnityEngine.SceneManagement.Scene scene, BuildReport report)
{
var context = SceneProcessingPipeline.Begin("testasset");
try
{
SceneProcessingPipeline.ProcessScene(context, scene);
}
finally
{
SceneProcessingPipeline.End(context);
}
}
}
I hope you can revisit your VersionedCallback implementation and come up with something that solves the issue for me. Thank you in advance.