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.

AdaptivePerformanceLoader.cs 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using UnityEngine.Rendering;
  4. namespace UnityEngine.AdaptivePerformance
  5. {
  6. /// <summary>
  7. /// Adaptive Performance Loader abstract class used as a base class for specific provider implementations. Providers should implement
  8. /// subclasses of this to provide specific initialization and management implementations that make sense for their supported
  9. /// scenarios and needs.
  10. /// </summary>
  11. public abstract class AdaptivePerformanceLoader : ScriptableObject
  12. {
  13. /// <summary>
  14. /// Initialize the loader. This should initialize all subsystems to support the desired runtime setup this
  15. /// loader represents.
  16. /// </summary>
  17. ///
  18. /// <returns>Whether or not initialization succeeded.</returns>
  19. public virtual bool Initialize() { return true; }
  20. /// <summary>
  21. /// Ask loader to start all initialized subsystems.
  22. /// </summary>
  23. ///
  24. /// <returns>Whether or not all subsystems were successfully started.</returns>
  25. public virtual bool Start() { return true; }
  26. /// <summary>
  27. /// Ask loader to stop all initialized subsystems.
  28. /// </summary>
  29. ///
  30. /// <returns>Whether or not all subsystems were successfully stopped.</returns>
  31. public virtual bool Stop() { return true; }
  32. /// <summary>
  33. /// Ask loader to deinitialize all initialized subsystems.
  34. /// </summary>
  35. ///
  36. /// <returns>Whether or not deinitialization succeeded.</returns>
  37. public virtual bool Deinitialize() { return true; }
  38. /// <summary>
  39. /// Gets the loaded subsystem of the specified type. This is implementation-specific, because implementations contain data on
  40. /// what they have loaded and how best to get it.
  41. /// </summary>
  42. ///
  43. /// <typeparam name="T">Type of the subsystem to get.</typeparam>
  44. ///
  45. /// <returns>The loaded subsystem, or null if no subsystem found.</returns>
  46. public abstract T GetLoadedSubsystem<T>() where T : class, ISubsystem;
  47. /// <summary>
  48. /// Gets the loaded default subsystem.
  49. /// </summary>
  50. /// <returns>The loaded subsystem, or null if no default subsystem is loaded.</returns>
  51. public abstract ISubsystem GetDefaultSubsystem();
  52. /// <summary>
  53. /// Gets the Settings of the loader used to descibe the loader and subsystems.
  54. /// </summary>
  55. /// <returns>The settings of the loader.</returns>
  56. public abstract IAdaptivePerformanceSettings GetSettings();
  57. }
  58. }