# ObjectIdentifier

> Struct that identifies a specific object project wide.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEditor.Build.Content](/engine/6000.6/script-reference/unityeditor/build/content.md)
* **Assembly:** UnityEditor.CoreModule
* **Implements:** [IEquatable\<ObjectIdentifier>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IComparable\<ObjectIdentifier>](https://learn.microsoft.com/dotnet/api/system.icomparable-1)

```csharp
public struct ObjectIdentifier : IEquatable<ObjectIdentifier>, IComparable<ObjectIdentifier>
```

## Remarks

Note: this struct and its members exist to provide low-level support for the **Scriptable Build Pipeline** package. This is intended for internal use only; use the [Scriptable Build Pipeline package](https://docs.unity3d.com/Packages/com.unity.scriptablebuildpipeline@latest/index.html) to implement a fully featured build pipeline. You can install this via the [Package Manager window](/engine/6000.6/manual/packages-list/upm-ui-window/upm-ui.md).

## Properties

| Property                                                                                                                     | Description                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| [filePath](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/filepath.md)                           | The file path on disk that contains this object. (Only used for objects not known by the AssetDatabase). |
| [fileType](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/filetype.md)                           | Type of file that contains this object.                                                                  |
| [guid](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/guid.md)                                   | The specific asset that contains this object.                                                            |
| [localIdentifierInFile](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/localidentifierinfile.md) | The index of the object inside a serialized file.                                                        |

## Methods

| Method                                                                                                   | Description                                                  |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [CompareTo](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/compareto.md)     | Implements the IComparable interface.                        |
| [Equals](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/equals.md)           | Returns true if the objects are equal.                       |
| [GetHashCode](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/gethashcode.md) | Gets the hash code for the ObjectIdentifier.                 |
| [ToString](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/tostring.md)       | Returns a nicely formatted string for this ObjectIdentifier. |

## Static Methods

| Method                                                                                                                         | Description                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| [ToEntityId](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/toentityid.md)                         | Tries to return the EntityId that represents this ObjectIdentifier.               |
| [ToObject](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/toobject.md)                             | Tries to find, load, and return the Object that represents this ObjectIdentifier. |
| [TryGetObjectIdentifier](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/trygetobjectidentifier.md) | Tries to convert a persistent Object into an ObjectIdentifier.                    |

## Operators

| Operator                                                                                                   | Description                                          |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [operator ==](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/op-equality.md)   | Returns true if the ObjectIdentifiers are the same.  |
| [operator !=](/engine/6000.6/script-reference/unityeditor/build/content/objectidentifier/op-inequality.md) | Returns true if the ObjectIdentifiers are different. |
