Table of Contents

Class DLCContent

Namespace
DLCToolkit
Assembly
DLCToolkit.dll

Represents a DLC loaded in memory. Provides access to metadata, icons, plus API's for loading assets and scenes. Will remain in memory until Unload(bool), Dispose() or until the game exits.

public sealed class DLCContent : MonoBehaviour, IDLCAsyncProvider, IDisposable
Inheritance
Object
Component
Behaviour
MonoBehaviour
DLCContent
Implements
Inherited Members
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.transform
Component.gameObject
Component.tag
Object.GetInstanceID()
Object.GetHashCode()
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Fields

OnUnloaded

Called when the DLC content has finished unloading. Usually this means an unload request was made of the content was disposed.

[HideInInspector]
public UnityEvent OnUnloaded

Field Value

UnityEvent

OnWillUnload

Called when the DLC content is just about to be unloaded. Usually this means an unload request was made of the content was disposed.

[HideInInspector]
public UnityEvent OnWillUnload

Field Value

UnityEvent

Properties

HintLoadPath

Get the local path where the DLC content was loaded from.

public string HintLoadPath { get; }

Property Value

string

Exceptions

DLCNotLoadedException

The DLC is not currently loaded

IconProvider

Get the IDLCIconProvider for the loaded DLC content. Provides access to all icons associated with the DLC if available.

public IDLCIconProvider IconProvider { get; }

Property Value

IDLCIconProvider

Exceptions

DLCNotLoadedException

The DLC is not currently loaded

IsLoaded

Check if the DLC content has been successfully loaded.

public bool IsLoaded { get; }

Property Value

bool

IsLoading

Check if the DLC content is currently loading.

public bool IsLoading { get; }

Property Value

bool

Metadata

Get the IDLCMetadata for the loaded DLC content. Provides access to useful metadata such as name, version, author information and more.

public IDLCMetadata Metadata { get; }

Property Value

IDLCMetadata

Exceptions

DLCNotLoadedException

The DLC is not currently loaded

NameInfo

Get the IDLCNameInfo for the loaded DLC content. Provides access to useful identifying data such as name, version and unique key.

public IDLCNameInfo NameInfo { get; }

Property Value

IDLCNameInfo

Exceptions

DLCNotLoadedException

The DLC is not currently loaded

SceneAssets

Get a collection DLCSceneAsset for the loaded DLC content listing each scene asset that was included. Scene assets are simply Unity scenes. Provides access to useful asset metadata such as name, path, extension, type and more.

public DLCAssetCollection<DLCSceneAsset> SceneAssets { get; }

Property Value

DLCAssetCollection<DLCSceneAsset>

Exceptions

DLCNotLoadedException

The DLC is not currently loaded or is loaded in metadata only mode

SharedAssets

Get a collection DLCSharedAsset for the loaded DLC content listing each asset that was included. Shared assets are all non-scene assets types such as prefab, texture, material, audio clip, etc. Provides access to useful asset metadata such as name, path, extension, type and more.

public DLCAssetCollection<DLCSharedAsset> SharedAssets { get; }

Property Value

DLCAssetCollection<DLCSharedAsset>

Exceptions

DLCNotLoadedException

The DLC is not currently loaded or is loaded in metadata only mode

Methods

Dispose()

Unload this DLC and release all associated resources. Will call Unload(bool) with true argument internally to cause the DLC to be unloaded from memory. Note that this will cause the DLCContent container object to be recycled and will become available for other load operations. For that reason references should not be kept after dispose has been called.

public void Dispose()

Unload(bool)

Request that the DLC contents be unloaded from memory. This will case DLC metadata, assets and scenes to be unloaded. Note that the DLCContent container object will not be destroyed and will remain in memory until manually destroyed. Use Dispose() to unload the content and to recycle the DLCContent container object for use in other DLC load operations.

public void Unload(bool withAssets = true)

Parameters

withAssets bool

Should asset instances also be unloaded