Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PPv2ConversionIndexers.cs 1.6KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #if PPV2_EXISTS
  2. using UnityEditor.Search;
  3. using UnityEngine;
  4. using BIRPRendering = UnityEngine.Rendering.PostProcessing;
  5. namespace UnityEditor.Rendering.Universal
  6. {
  7. static class PPv2ConversionIndexers
  8. {
  9. // Note: Iterating this version number does not force an index rebuild.
  10. // If modifying this code, you will need to either delete the Library directory,
  11. // or open "Window > Search > Index Manager" and right-click each indexer to do a Force Rebuild.
  12. private const int Version = 10;
  13. [CustomObjectIndexer(typeof(Object), version = Version)]
  14. internal static void ConversionIndexer(CustomObjectIndexerTarget context, ObjectIndexer indexer)
  15. {
  16. // Note: Volumes and Layers on the same object would still produce only a
  17. // single result in the "urp:convert-ppv2component" search, thus we only
  18. // explicitly add one or the other here, instead of both.
  19. if (context.targetType == typeof(BIRPRendering.PostProcessVolume))
  20. {
  21. indexer.AddProperty("urp", "convert-ppv2component", context.documentIndex);
  22. }
  23. else if (context.targetType == typeof(BIRPRendering.PostProcessLayer))
  24. {
  25. indexer.AddProperty("urp", "convert-ppv2component", context.documentIndex);
  26. }
  27. if (context.targetType == typeof(BIRPRendering.PostProcessProfile))
  28. {
  29. indexer.AddProperty("urp", "convert-ppv2scriptableobject", context.documentIndex);
  30. }
  31. }
  32. }
  33. }
  34. #endif