部分代码重构,AR起步冲的问题和停车动画调整
This commit is contained in:
1 parent
71b6155946
commit
fb4da81ce2
18 files changed
+3520
-4391
No files matched your search
@@ -0,0 +1,34 @@
|
||||
using System.Text;
|
||||
|
||||
public static class ObjectExtension
|
||||
{
|
||||
public static string ToEllipsisString(this string message, int length)
|
||||
{
|
||||
var index = 0;
|
||||
var sb = new StringBuilder();
|
||||
foreach (var item in message)
|
||||
{
|
||||
if (IsChineseCharacter(item))
|
||||
{
|
||||
index += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
index += 1;
|
||||
}
|
||||
|
||||
sb.Append(item);
|
||||
if (length <= index)
|
||||
{
|
||||
return sb.Append("...").ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static bool IsChineseCharacter(char c)
|
||||
{
|
||||
return (19968 <= (int)c) && ((int)c <= 171941);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6474a1d1e1c3429dba1abc390b5e67e9
|
||||
timeCreated: 1678262635
|
||||
Reference in new issue
Block a user