UnityGame/Library/PackageCache/com.unity.render-pipelines.universal/Editor/Converter/PPv2/PPv2ConversionIndexers.cs
2024-10-27 10:53:47 +03:00

38 lines
1.6 KiB
C#

#if PPV2_EXISTS
using UnityEditor.Search;
using UnityEngine;
using BIRPRendering = UnityEngine.Rendering.PostProcessing;
namespace UnityEditor.Rendering.Universal
{
static class PPv2ConversionIndexers
{
// Note: Iterating this version number does not force an index rebuild.
// If modifying this code, you will need to either delete the Library directory,
// or open "Window > Search > Index Manager" and right-click each indexer to do a Force Rebuild.
private const int Version = 10;
[CustomObjectIndexer(typeof(Object), version = Version)]
internal static void ConversionIndexer(CustomObjectIndexerTarget context, ObjectIndexer indexer)
{
// Note: Volumes and Layers on the same object would still produce only a
// single result in the "urp:convert-ppv2component" search, thus we only
// explicitly add one or the other here, instead of both.
if (context.targetType == typeof(BIRPRendering.PostProcessVolume))
{
indexer.AddProperty("urp", "convert-ppv2component", context.documentIndex);
}
else if (context.targetType == typeof(BIRPRendering.PostProcessLayer))
{
indexer.AddProperty("urp", "convert-ppv2component", context.documentIndex);
}
if (context.targetType == typeof(BIRPRendering.PostProcessProfile))
{
indexer.AddProperty("urp", "convert-ppv2scriptableobject", context.documentIndex);
}
}
}
}
#endif