using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; namespace UnityEngine.XR.Management { /// /// XR Loader abstract class used as a base class for specific provider implementations. Providers should implement /// subclasses of this to provide specific initialization and management implementations that make sense for their supported /// scenarios and needs. /// public abstract class XRLoader : ScriptableObject { /// /// Initialize the loader. This should initialize all subsystems to support the desired runtime setup this /// loader represents. /// /// This is the only method on XRLoader that Management uses to determine the active loader to use. If this /// method returns true, Management locks this loader as the /// and and stops fall through processing on the list of current loaders. /// /// If this method returns false, continues to process the next loader /// in the list, or fails completely when the list is exhausted. /// /// /// Whether or not initialization succeeded. public virtual bool Initialize() { return true; } /// /// Ask loader to start all initialized subsystems. /// /// /// Whether or not all subsystems were successfully started. public virtual bool Start() { return true; } /// /// Ask loader to stop all initialized subsystems. /// /// /// Whether or not all subsystems were successfully stopped. public virtual bool Stop() { return true; } /// /// Ask loader to deinitialize all initialized subsystems. /// /// /// Whether or not deinitialization succeeded. public virtual bool Deinitialize() { return true; } /// /// Gets the loaded subsystem of the specified type. Implementation dependent as only implemetnations /// know what they have loaded and how best to get it.. /// /// /// Type of the subsystem to get /// /// The loaded subsystem or null if not found. public abstract T GetLoadedSubsystem() where T : class, ISubsystem; /// /// Gets the loader's supported graphics device types. If the list is empty, it is assumed that it supports all graphics device types. /// /// /// True if the player is being built. You may want to include or exclude graphics apis if the player is being built or not. /// Returns the loader's supported graphics device types. public virtual List GetSupportedGraphicsDeviceTypes(bool buildingPlayer) { return new List(); } } }