Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryGetObjectIdentifier

Tries to convert a persistent Object into an ObjectIdentifier.
Read time 1 minuteLast updated 7 days ago

Definition

TryGetObjectIdentifier(Object, ObjectIdentifier)

Tries to convert a persistent Object into an ObjectIdentifier.
public static bool TryGetObjectIdentifier(Object targetObject, out ObjectIdentifier objectId)

Parameters

targetObject


Returns

Type

Description

bool

Remarks

Returns false if it was not possible. This can happen if the Object is is a Scene Object, or was not loaded from and Object on disk.

TryGetObjectIdentifier(int, ObjectIdentifier)

Tries to convert a persistent Object into an ObjectIdentifier.
Warning
Deprecated. TryGetObjectIdentifier(int, out ObjectIdentifier) is deprecated. Use TryGetObjectIdentifier(EntityId, out ObjectIdentifier) instead.
public static bool TryGetObjectIdentifier(int instanceID, out ObjectIdentifier objectId)

Parameters

instanceID


Returns

Type

Description

bool

Remarks

Returns false if it was not possible. This can happen if the Object is is a Scene Object, or was not loaded from and Object on disk.

TryGetObjectIdentifier(EntityId, ObjectIdentifier)

Tries to convert a persistent Object into an ObjectIdentifier.
public static bool TryGetObjectIdentifier(EntityId entityId, out ObjectIdentifier objectId)

Parameters

entityId

The object identifier's entity id to look up.

Out parameter with the found object identifier.

Returns

Type

Description

bool

Remarks

Returns false if it was not possible. This can happen if the Object is a Scene Object, or was not loaded from and Object on disk.