Version: 2023.2

ObjectIdentifier.TryGetObjectIdentifier

切换到手册
public static bool TryGetObjectIdentifier (Object targetObject, out Build.Content.ObjectIdentifier objectId);
public static bool TryGetObjectIdentifier (int instanceID, out Build.Content.ObjectIdentifier objectId);

描述

Tries to convert a persistent Object into an ObjectIdentifier.

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.