# CreateLoadableObjectId

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

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## CreateLoadableObjectId(Object)

Creates a [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md) from a [Object](/engine/6000.7/script-reference/unityengine/object.md) that can be used for on-demand loading.

```csharp
public static LoadableObjectId CreateLoadableObjectId(Object obj)
```

### Parameters

**** (\[Object]\(/engine/6000.7/script-reference/unityengine/object)): A Unity [Object](/engine/6000.7/script-reference/unityengine/object.md) that has been serialized to disk as part of an Asset. Objects inside Scenes cannot be referenced by [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md).

### Returns

| Type                                                                                  | Description                                                                                                                                        |
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md) | 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. |

## CreateLoadableObjectId(EntityId)

Creates a [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md) from an [EntityId](/engine/6000.7/script-reference/unityengine/entityid.md).

```csharp
public static LoadableObjectId CreateLoadableObjectId(EntityId entityId)
```

### Parameters

**** (\[EntityId]\(/engine/6000.7/script-reference/unityengine/entityid)): The [EntityId](/engine/6000.7/script-reference/unityengine/entityid.md) of a Unity [Object](/engine/6000.7/script-reference/unityengine/object.md) that has been serialized to disk as part of an Asset. Objects inside Scenes cannot be referenced by [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md).

### Returns

| Type                                                                                  | Description                                                                                                                  |
| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md) | A [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md) that points to the specified object. |

## CreateLoadableObjectId(GUID, FileIdentifierType, long)

Creates a LoadableObjectId from its component parts.

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

### Parameters

**** (GUID): The GUID of the asset file containing the object.**** (\[FileIdentifierType]\(/engine/6000.7/script-reference/unityengine/fileidentifiertype)): The [FileIdentifierType](/engine/6000.7/script-reference/unityengine/fileidentifiertype.md) indicating whether this is a source asset, primary artifact, or non-asset reference.**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): The local file identifier of the object within the asset.

### Returns

| Type                                                                                  | Description                                                                                                                        |
| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md) | A [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md) constructed from the specified components. |

### Remarks

This method is the inverse of [LoadableObjectIdEditorUtility.TryDeconstructLoadableObjectId](/engine/6000.7/script-reference/unityeditor/loadableobjectideditorutility/trydeconstructloadableobjectid.md): it reconstructs a [LoadableObjectId](/engine/6000.7/script-reference/unity/loading/loadableobjectid.md) from the GUID, file identifier type, and local file identifier. Use [LoadableObjectIdEditorUtility.CreateLoadableObjectId](/engine/6000.7/script-reference/unityeditor/loadableobjectideditorutility/createloadableobjectid.md) or [LoadableObjectIdEditorUtility.CreateLoadableObjectId](/engine/6000.7/script-reference/unityeditor/loadableobjectideditorutility/createloadableobjectid.md) when constructing a reference from a live [Object](/engine/6000.7/script-reference/unityengine/object.md); 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](/engine/6000.7/script-reference/unityeditor/loadableobjectideditorutility/trydeconstructloadableobjectid.md), [GlobalObjectId](/engine/6000.7/script-reference/unityeditor/globalobjectid.md)
