Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

AdaptivePerformanceLoader.cs 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /// Returns if the provider loader was initialized successfully.
  15. /// </summary>
  16. public abstract bool Initialized { get; }
  17. /// <summary>
  18. /// Returns if the provider loader is currently running.
  19. /// </summary>
  20. public abstract bool Running { get; }
  21. /// <summary>
  22. /// Initialize the loader. This should initialize all subsystems to support the desired runtime setup this
  23. /// loader represents.
  24. /// </summary>
  25. ///
  26. /// <returns>Whether or not initialization succeeded.</returns>
  27. public virtual bool Initialize() { return true; }
  28. /// <summary>
  29. /// Ask loader to start all initialized subsystems.
  30. /// </summary>
  31. ///
  32. /// <returns>Whether or not all subsystems were successfully started.</returns>
  33. public virtual bool Start() { return true; }
  34. /// <summary>
  35. /// Ask loader to stop all initialized subsystems.
  36. /// </summary>
  37. ///
  38. /// <returns>Whether or not all subsystems were successfully stopped.</returns>
  39. public virtual bool Stop() { return true; }
  40. /// <summary>
  41. /// Ask loader to deinitialize all initialized subsystems.
  42. /// </summary>
  43. ///
  44. /// <returns>Whether or not deinitialization succeeded.</returns>
  45. public virtual bool Deinitialize() { return true; }
  46. /// <summary>
  47. /// Gets the loaded subsystem of the specified type. This is implementation-specific, because implementations contain data on
  48. /// what they have loaded and how best to get it.
  49. /// </summary>
  50. ///
  51. /// <typeparam name="T">Type of the subsystem to get.</typeparam>
  52. ///
  53. /// <returns>The loaded subsystem, or null if no subsystem found.</returns>
  54. public abstract T GetLoadedSubsystem<T>() where T : class, ISubsystem;
  55. /// <summary>
  56. /// Gets the loaded default subsystem.
  57. /// </summary>
  58. /// <returns>The loaded subsystem, or null if no default subsystem is loaded.</returns>
  59. public abstract ISubsystem GetDefaultSubsystem();
  60. /// <summary>
  61. /// Gets the Settings of the loader used to descibe the loader and subsystems.
  62. /// </summary>
  63. /// <returns>The settings of the loader.</returns>
  64. public abstract IAdaptivePerformanceSettings GetSettings();
  65. }
  66. }