Method TryAddLoader
TryAddLoader(XRLoader, int)
Attempts to append the given loader to the list of loaders at the given index.
Declaration
public bool TryAddLoader(XRLoader loader, int index = -1)
Parameters
Type | Name | Description |
---|---|---|
XRLoader | loader | The XRLoader to be added to this manager's instance of loaders. |
int | index | The index at which the given XRLoader should be added. If you set a negative or otherwise invalid index, the loader will be appended to the end of the list. |
Returns
Type | Description |
---|---|
bool |
|
Remarks
This method behaves differently in the Editor and during runtime/Play mode. While your app runs in the Editor and not in
Play mode, attempting to add an XRLoader will always succeed and register that loader's type
internally. Attempting to add a loader during runtime/Play mode will trigger a check to see whether a loader of
that type was registered. If the check is successful, the loader is added. If not, the loader is not added and the method
returns false
.