Class FunctionalityIsland
Contains a collection of functionality providers which can be used to inject functionality on functionality subscribers. Injecting functionality involves calling ConnectSubscriber on providers indicated by IFunctionalitySubscriber<> with the subscriber as an argument, allowing the provider to set itself on the subscriber's provider property which can then be accessed via extension methods defined alongside the subscriber interface
Inherited Members
Namespace: Unity.XRTools.ModuleLoader
Assembly: solution.dll
Syntax
[CreateAssetMenu(fileName = "Island", menuName = "ModuleLoader/Functionality Island")]
public class FunctionalityIsland : ScriptableObject, IProvidesFunctionalityInjection, IFunctionalityProvider
Fields
Name | Description |
---|---|
InjectFunctionalityProfilerLabel | Profiler label for InjectFunctionality |
RequireProvidersProfilerLabel | Profiler label for RequireProviders |
SetupDefaultProvidersProfilerLabel | Profiler label for SetupDefaultProviders |
Properties
Name | Description |
---|---|
defaultProviders | Array of DefaultProviders specified by this island |
providers | Dictionary of provider instances which are currently loaded on this island, keyed by the provider interface type |
uniqueProviders | Set of unique providers--the providers dictionary may contain a provider object in more than one slot |
Methods
Name | Description |
---|---|
ActivateProviderGameObjects() | Activate all GameObjects backing MonoBehavior providers |
AddProvider(Type, IFunctionalityProvider) | Add a provider to a specific slot in the providers list |
AddProviders(List<IFunctionalityProvider>) | Add a list of functionality providers to this island |
CanAddProviderType(Type) | Return true if the given type of provider can be added to this functionality island If the given type does not implement any provider interfaces which haven't already been added, it cannot be added |
CheckSetup() | Log a warning if this Functionality Island has not been set up |
ConnectSubscriber(object) | Called by the |
GetOrCreateProviderInstance(Type, Type) | Get or create an instance of the given provider type |
GetProviderSelectionOptions(Type) | Returns the ProviderPriority attribute for a given type, if it exists |
InjectFunctionality(List<object>, List<IFunctionalityProvider>) | Inject functionality on a list of objects |
InjectFunctionality(List<IFunctionalitySubscriber>, List<IFunctionalityProvider>) | Inject functionality on a list of subscribers |
InjectFunctionality(GameObject) | Inject functionality on all components of a GameObject which implement IFunctionalitySubscriber |
InjectFunctionality(Scene) | Inject functionality on an entire scene, assuming that |
InjectFunctionalityInDefaultProviders(Dictionary<GameObject, GameObject>, List<IFunctionalityProvider>) | Inject functionality on providers that were created during the RequireDefaultProviders process |
InjectFunctionalitySingle(object) | Inject functionality on a single object, assuming all providers have been set up. |
InjectPreparedFunctionality(List<object>) | Inject functionality on a set of objects, assuming that all required providers have been set up. |
InjectPreparedFunctionality(List<IFunctionalitySubscriber>) | Inject functionality on a set of objects, assuming that all required providers have been setup. |
LoadProvider() | Called when the provider is loaded into a |
OnBehaviorDestroy() | Called by ModuleCallbacksBehaviour OnDestroy as early as possible (using a very low Script Execution Order) |
PrepareFunctionalityForSubscriberTypes(HashSet<Type>, List<IFunctionalityProvider>) | Set up providers for a given set of subscriber types |
PrintStatus() | Return a string describing what providers have been added to each island. This is useful to debug issues related to functionality injection when the issue occurs during load or when the asset's inspector does not provide helpful information. |
RemoveProviders(List<IFunctionalityProvider>) | Remove a list of providers from this functionality island |
SetupDefaultProviders(HashSet<Type>, List<IFunctionalityProvider>) | Set up functionality providers from the list of default providers This allows custom serialized data to be set up on prefabs for providers |
Unload() | Unload this island and all of its providers |
UnloadProvider() | Called when the provider is unloaded by the containing |