分散文件结构,添加了枚举类型的一个辅助类
This commit is contained in:
41
Runtime/MicroLibrary/MacroString.cs
Normal file
41
Runtime/MicroLibrary/MacroString.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace XericLibrary.Runtime.MacroLibrary
|
||||
{
|
||||
public static partial class MacroMath
|
||||
{
|
||||
|
||||
#region <EFBFBD>ı<EFBFBD>
|
||||
|
||||
/// <summary>
|
||||
/// <20><>ȡ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>clone<6E><65><EFBFBD><EFBFBD><EFBFBD><D7BA><EFBFBD><EFBFBD>ʡ<EFBFBD><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static string GetGameObjectNameWithoutClone(GameObject gameObject)
|
||||
{
|
||||
return GetGameObjectNameWithoutClone(gameObject.name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><>ȡ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>clone<6E><65><EFBFBD><EFBFBD><EFBFBD><D7BA><EFBFBD><EFBFBD>ʡ<EFBFBD><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static string GetGameObjectNameWithoutClone(string gameObjectName)
|
||||
{
|
||||
const string cloneSuffix = "(Clone)";
|
||||
if(gameObjectName.EndsWith(cloneSuffix))
|
||||
{
|
||||
int suffixIndex = gameObjectName.LastIndexOf(cloneSuffix);
|
||||
string nameWithoutClone = gameObjectName.Substring(0, suffixIndex);
|
||||
return nameWithoutClone;
|
||||
}
|
||||
return gameObjectName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user