Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

LoadableObjectIdEditorUtility.CreateLoadableObjectId

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static LoadableObjectId CreateLoadableObjectId(Object obj);

Parameters

Parameter Description
obj A Unity Object that has been serialized to disk as part of an Asset. Objects inside Scenes cannot be referenced by LoadableObjectId.

Returns

LoadableObjectId A LoadableObjectId that points to the specified object, or an empty LoadableObjectId if obj is null or if it does not belong to a persisted asset.

Description

Creates a LoadableObjectId from a Object that can be used for on-demand loading.


Declaration

public static LoadableObjectId CreateLoadableObjectId(EntityId entityId);

Parameters

Parameter Description
entityId The EntityId of a Unity Object that has been serialized to disk as part of an Asset. Objects inside Scenes cannot be referenced by LoadableObjectId.

Returns

LoadableObjectId A LoadableObjectId that points to the specified object.

Description

Creates a LoadableObjectId from an EntityId.


Declaration

public static LoadableObjectId CreateLoadableObjectId(GUID guid, FileIdentifierType fileType, long localId);

Parameters

Parameter Description
guid The GUID of the asset file containing the object.
fileType The FileIdentifierType indicating whether this is a source asset, primary artifact, or non-asset reference.
localId The local file identifier of the object within the asset.

Returns

LoadableObjectId A LoadableObjectId constructed from the specified components.

Description

Creates a LoadableObjectId from its component parts.

This method is the inverse of LoadableObjectIdEditorUtility.TryDeconstructLoadableObjectId: it reconstructs a LoadableObjectId from the GUID, file identifier type, and local file identifier. Use LoadableObjectIdEditorUtility.CreateLoadableObjectId or LoadableObjectIdEditorUtility.CreateLoadableObjectId when constructing a reference from a live Object; use this overload only when the component parts are already known (for example, when persisting and restoring a reference in tooling).

Additional resources: LoadableObjectIdEditorUtility.TryDeconstructLoadableObjectId, GlobalObjectId