暫無描述
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.

SystemConverter.cs 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #if UNITY_2022_2_OR_NEWER
  2. using System;
  3. namespace Unity.AI.Navigation.Editor.Converter
  4. {
  5. internal abstract class SystemConverter
  6. {
  7. /// <summary>
  8. /// Name of the converter.
  9. /// </summary>
  10. public abstract string name { get; }
  11. /// <summary>
  12. /// The information when hovering over the converter.
  13. /// </summary>
  14. public abstract string info { get; }
  15. /// <summary>
  16. /// 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.
  17. /// </summary>
  18. public virtual bool isEnabled => true;
  19. /// <summary>
  20. /// 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.
  21. /// </summary>
  22. public virtual int priority => 0;
  23. /// <summary>
  24. /// A check to see if the converter needs to create the index.
  25. /// This will only need to be set to true if the converter is using search api, and search queries.
  26. /// If set to true the converter framework will create the indexer and remove it after all search queries are done.
  27. /// </summary>
  28. public virtual bool needsIndexing => false;
  29. /// <summary>
  30. /// This method getting triggered when clicking the listview item in the UI.
  31. /// </summary>
  32. public virtual void OnClicked(int index)
  33. {
  34. }
  35. // This is so that we can have different segment in our UI, example Unity converters, your custom converters etc..
  36. // This is not implemented yet
  37. public virtual string category { get; }
  38. // This is in which drop down item the converter belongs to.
  39. // Not properly implemented yet
  40. public abstract Type container { get; }
  41. /// <summary>
  42. /// This runs when initializing the converter. To gather data for the UI and also for the converter if needed.
  43. /// </summary>
  44. /// <param name="context">The context that will be used to initialize data for the converter.</param>
  45. public abstract void OnInitialize(InitializeConverterContext context, Action callback);
  46. /// <summary>
  47. /// The method that will be run before Run method if needed.
  48. /// </summary>
  49. public virtual void OnPreRun()
  50. {
  51. }
  52. /// <summary>
  53. /// The method that will be run when converting the assets.
  54. /// </summary>
  55. /// <param name="context">The context that will be used when executing converter.</param>
  56. public abstract void OnRun(ref RunItemContext context);
  57. /// <summary>
  58. /// The method that will be run after the converters are done if needed.
  59. /// </summary>
  60. public virtual void OnPostRun()
  61. {
  62. }
  63. }
  64. }
  65. #endif