GameObjectUtility.GetUniqueNameForSibling

Switch to Manual
public static string GetUniqueNameForSibling (Transform parent, string name);

Parameters

parent GameObject 的目标父级。Null 表示根级。
name GameObject 的请求名称。

Returns

stringGameObject 的唯一名称。

Description

与现有同级对象相比,获得新 GameObject 的唯一名称。对于尝试避免重复命名非常有用。发现重复名称时,在基本名称后使用增量数字。