Skip to content

Commit e0f8bc1

Browse files
committed
fix(Util): Use object for clone functions
1 parent f6b41ea commit e0f8bc1

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Assets/JCSUnity/Scripts/Util/JCS_Util.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,26 +1009,18 @@ public static void DestroyImmediateAllTypeObjectInScene<T>()
10091009
#region Clone
10101010

10111011
/// <summary>
1012-
/// Return true if the game object is a clone.
1012+
/// Return true if the object is a clone.
10131013
/// </summary>
1014-
public static bool IsClone(Transform trans)
1015-
{
1016-
return IsClone(trans.gameObject);
1017-
}
1018-
public static bool IsClone(GameObject obj)
1014+
public static bool IsClone(Object obj)
10191015
{
10201016
return obj.name.Contains("(Clone)");
10211017
}
10221018

10231019
/// <summary>
1024-
/// Remove the text "(Clone)" from game object's name,
1020+
/// Remove the text "(Clone)" from object's name,
10251021
/// and return the new name string.
10261022
/// </summary>
1027-
public static string RemoveCloneString(Transform trans)
1028-
{
1029-
return RemoveCloneString(trans.gameObject);
1030-
}
1031-
public static string RemoveCloneString(GameObject obj)
1023+
public static string RemoveCloneString(Object obj)
10321024
{
10331025
obj.name = obj.name.Replace("(Clone)", "");
10341026

0 commit comments

Comments
 (0)