mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-17 09:24:37 +08:00
Update MetaIDAttribute.cs
This commit is contained in:
parent
94dc9daa67
commit
90d57539ae
@ -114,28 +114,26 @@ namespace DCFApixels.DragonECS
|
||||
}
|
||||
public static string ParseIDFromTypeName(string name)
|
||||
{
|
||||
using (StackAllocator.Alloc(name.Length, out char* buffer))
|
||||
char* buffer = TempBuffer<MetaIDAttribute, char>.Get(name.Length);
|
||||
int count = 0;
|
||||
//skip name[0] char
|
||||
for (int i = 1, iMax = name.Length; i < iMax; i++)
|
||||
{
|
||||
int count = 0;
|
||||
//skip name[0] char
|
||||
for (int i = 1, iMax = name.Length; i < iMax; i++)
|
||||
char current = name[i];
|
||||
if (current == '_')
|
||||
{
|
||||
char current = name[i];
|
||||
if (current == '_')
|
||||
if (++i >= iMax) { break; }
|
||||
current = name[i];
|
||||
switch (current)
|
||||
{
|
||||
if (++i >= iMax) { break; }
|
||||
current = name[i];
|
||||
switch (current)
|
||||
{
|
||||
case '1': current = '<'; break;
|
||||
case '2': current = '>'; break;
|
||||
case '3': current = ','; break;
|
||||
}
|
||||
case '1': current = '<'; break;
|
||||
case '2': current = '>'; break;
|
||||
case '3': current = ','; break;
|
||||
}
|
||||
buffer[count++] = current;
|
||||
}
|
||||
return new string(buffer, 0, count);
|
||||
buffer[count++] = current;
|
||||
}
|
||||
return new string(buffer, 0, count);
|
||||
}
|
||||
|
||||
public static string GenerateNewUniqueIDWithAttribute()
|
||||
|
Loading…
Reference in New Issue
Block a user