Class HostingServicesManager
Manages the hosting services.
Namespace: UnityEditor.AddressableAssets.HostingServices
Syntax
[Serializable]
public class HostingServicesManager : ISerializationCallbackReceiver
Constructors
HostingServicesManager()
Create a new HostingServicesManager
Declaration
public HostingServicesManager()
Properties
GlobalProfileVariables
Key/Value pairs valid for profile variable substitution
Declaration
public Dictionary<string, string> GlobalProfileVariables { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<String, String> |
HostingServices
Return an enumerable list of all configured IHostingService objects
Declaration
public ICollection<IHostingService> HostingServices { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<IHostingService> |
IsInitialized
Indicates whether or not this HostingServiceManager is initialized
Declaration
public bool IsInitialized { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Logger
Direct logging output of all managed services
Declaration
public ILogger Logger { get; set; }
Property Value
| Type | Description |
|---|---|
| ILogger |
NextInstanceId
The id value that will be assigned to the next IHostingService add to the manager.
Declaration
public int NextInstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
RegisteredServiceTypes
Get an array of all IHostingService types that have been used by the manager, or are known built-in types available for use.
Declaration
public Type[] RegisteredServiceTypes { get; }
Property Value
| Type | Description |
|---|---|
| Type[] |
Methods
AddHostingService(Type, String)
Add a new hosting service instance of the given type. The serviceType must implement the
IHostingService interface, or an ArgumentException is thrown.
Declaration
public IHostingService AddHostingService(Type serviceType, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | serviceType | A Type object for the service. Must implement IHostingService |
| String | name | A descriptive name for the new service instance. |
Returns
| Type | Description |
|---|---|
| IHostingService |
BatchMode()
Static method for use in starting up the HostingServicesManager in batch mode. This method without parameters will find and use the default AddressableAssetSettings object.
Declaration
public static void BatchMode()
BatchMode(AddressableAssetSettings)
Static method for use in starting up the HostingServicesManager in batch mode.
Declaration
public static void BatchMode(AddressableAssetSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| AddressableAssetSettings | settings |
Initialize(AddressableAssetSettings)
Initialize manager with the given AddressableAssetSettings object.
Declaration
public void Initialize(AddressableAssetSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| AddressableAssetSettings | settings |
OnAfterDeserialize()
Ensure object is ready for serialization, and calls OnBeforeSerialize(KeyDataStore) methods on all managed IHostingService instances
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Ensure object is ready for serialization, and calls OnBeforeSerialize(KeyDataStore) methods on all managed IHostingService instances
Declaration
public void OnBeforeSerialize()
OnDisable()
Should be called by parent
Declaration
public void OnDisable()
OnEnable()
Should be called by parent
Declaration
public void OnEnable()
RefreshGlobalProfileVariables()
Refresh values in the global profile variables table.
Declaration
public void RefreshGlobalProfileVariables()
RemoveHostingService(IHostingService)
Stops the given IHostingService, unregisters callbacks, and removes it from management. This function does nothing if the service is not being managed by this HostingServicesManager
Declaration
public void RemoveHostingService(IHostingService svc)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostingService | svc |
StartAllServices()
Calls StartHostingService() on all managed IHostingService instances where IsHostingServiceRunning is false
Declaration
public void StartAllServices()
StopAllServices()
Calls StopHostingService() on all managed IHostingService instances where IsHostingServiceRunning is true
Declaration
public void StopAllServices()