No Description
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.

RenderPipelineConverter.cs 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. [assembly: InternalsVisibleTo("PPv2URPConverters")]
  4. [assembly: InternalsVisibleTo("Unity.2D.PixelPerfect.Editor")]
  5. namespace UnityEditor.Rendering.Universal
  6. {
  7. // Might need to change this name before making it public
  8. internal abstract class RenderPipelineConverter
  9. {
  10. /// <summary>
  11. /// Name of the converter.
  12. /// </summary>
  13. public abstract string name { get; }
  14. /// <summary>
  15. /// The information when hovering over the converter.
  16. /// </summary>
  17. public abstract string info { get; }
  18. /// <summary>
  19. /// A check if the converter is enabled or not. Can be used to do a check if prerequisites are met to have it enabled or disabled.
  20. /// </summary>
  21. public virtual bool isEnabled => true;
  22. /// <summary>
  23. /// A priority of the converter. The lower the number (can be negative), the earlier it will be executed. Can be used to make sure that a converter runs before another converter.
  24. /// </summary>
  25. public virtual int priority => 0;
  26. /// <summary>
  27. /// A check to see if the converter needs to create the index.
  28. /// This will only need to be set to true if the converter is using search api, and search queries.
  29. /// If set to true the converter framework will create the indexer and remove it after all search queries are done.
  30. /// </summary>
  31. public virtual bool needsIndexing => false;
  32. /// <summary>
  33. /// This method getting triggered when clicking the listview item in the UI.
  34. /// </summary>
  35. public virtual void OnClicked(int index)
  36. {
  37. }
  38. // This is so that we can have different segment in our UI, example Unity converters, your custom converters etc..
  39. // This is not implemented yet
  40. public virtual string category { get; }
  41. // This is in which drop down item the converter belongs to.
  42. // Not properly implemented yet
  43. public abstract Type container { get; }
  44. /// <summary>
  45. /// This runs when initializing the converter. To gather data for the UI and also for the converter if needed.
  46. /// </summary>
  47. /// <param name="context">The context that will be used to initialize data for the converter.</param>
  48. public abstract void OnInitialize(InitializeConverterContext context, Action callback);
  49. /// <summary>
  50. /// The method that will be run before Run method if needed.
  51. /// </summary>
  52. public virtual void OnPreRun()
  53. {
  54. }
  55. /// <summary>
  56. /// The method that will be run when converting the assets.
  57. /// </summary>
  58. /// <param name="context">The context that will be used when executing converter.</param>
  59. public abstract void OnRun(ref RunItemContext context);
  60. /// <summary>
  61. /// The method that will be run after the converters are done if needed.
  62. /// </summary>
  63. public virtual void OnPostRun()
  64. {
  65. }
  66. }
  67. }