My Unity version is 6000.0.0f1c1.
I’m using my custom render pipeline and global settings, but error occurs in the override function “Initialize” when building. The definition in the base class is:
public class RenderPipelineGlobalSettings : ScriptableObject, ISerializationCallbackReceiver
{
......
public virtual void Initialize(RenderPipelineGlobalSettings source = null);
......
}
And my override version is:
public class CustomRenderPipelineGlobalSettings : RenderPipelineGlobalSettings
{
......
public override void Initialize(RenderPipelineGlobalSettings source = null)
......
}
Clearly they’re the same. But when I build my game on Windows, Intel 64-bit, error occurs:
error CS0115: ‘CustomRenderPipelineGlobalSettings.Initialize(RenderPipelineGlobalSettings)’: no suitable method found to override.
Did anyone happen to meet this problem? I totally don’t know what to do with it.
Here’s more code about the class that arise this problem.
[SupportedOnRenderPipeline(typeof(CustomPipelineAsset))]
public class CustomRenderPipelineGlobalSettings : RenderPipelineGlobalSettings
{
[SerializeField]
private static CustomRenderPipelineGlobalSettings cachedInstance = null;
public static CustomRenderPipelineGlobalSettings instance
{
get
{
if (cachedInstance == null)
cachedInstance = GraphicsSettings.GetSettingsForRenderPipeline<CustomRenderPipeline>() as CustomRenderPipelineGlobalSettings;
return cachedInstance;
}
}
[SerializeReference]
private List<IRenderPipelineGraphicsSettings> m_SettingsList = new();
protected override List<IRenderPipelineGraphicsSettings> settingsList => m_SettingsList;
public override void Initialize(RenderPipelineGlobalSettings source = null)
{
Add(new CustomRenderPipelineRuntimeShaders());
}