|
@@ -21,6 +21,7 @@ public class LabelUtility : MonoBehaviour
|
|
|
|
|
|
private static string Mark = "//Mark";
|
|
|
private static string Prefix = "public static string ";
|
|
|
+ private static string LanguagePageSeperator = "__";
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -118,11 +119,11 @@ public class LabelUtility : MonoBehaviour
|
|
|
string insertStr;
|
|
|
if (i == 0)
|
|
|
{
|
|
|
- insertStr = $"\t{Prefix}{node.Name} = \"{node.Name}\"\r\n;";
|
|
|
+ insertStr = $"\t{Prefix}{node.Name} = \"{node.Name}\";\r\n";
|
|
|
stringBuilder.Insert(insertIndex, insertStr);
|
|
|
insertIndex += insertStr.Length;
|
|
|
}
|
|
|
- insertStr = $"\t{Prefix}{node.Name}__{childNode.Name} = \"{node.Name}__{childNode.Name}\";";
|
|
|
+ insertStr = $"\t{Prefix}{node.Name}{LanguagePageSeperator}{childNode.Name} = \"{node.Name}{LanguagePageSeperator}{childNode.Name}\";";
|
|
|
stringBuilder.Insert(insertIndex, insertStr);
|
|
|
insertIndex += insertStr.Length;
|
|
|
|
|
@@ -143,6 +144,11 @@ public class LabelUtility : MonoBehaviour
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static string ConbineLanguageLabel(string page, string id)
|
|
|
+ {
|
|
|
+ return $"{page}{LanguagePageSeperator}{id}";
|
|
|
+ }
|
|
|
+
|
|
|
//public void ReplaceLabels()
|
|
|
//{
|
|
|
// Transform[] transforms = Prefabs[0].GetComponentsInChildren<Transform>(true);
|
|
@@ -212,7 +218,7 @@ public class LabelUtility : MonoBehaviour
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- fileStr = fileStr.ReplaceByLength(match.Index, match.Length, $"LanguageLabel.{strings[0].Trim('"')}__{strings[1].Trim('"')}");
|
|
|
+ fileStr = fileStr.ReplaceByLength(match.Index, match.Length, $"LanguageLabel.{strings[0].Trim('"')}{LanguagePageSeperator}{strings[1].Trim('"')}");
|
|
|
match = Regex.Match(fileStr, pattern);
|
|
|
}
|
|
|
}
|