在做unity3d的一个增强工具,用到了下

有需要的朋友凑合看,go.name是string类型

 

go.name = Selection.activeGameObject.name;
Regex rex = new Regex(@"\d{1,}", RegexOptions.RightToLeft);
var result = rex.Match(go.name);
if (result.Success)
{
    var tmp = int.Parse(result.Groups[0].Value);
    tmp++;
    go.name = rex.Replace(go.name, tmp.ToString());
}
else
{
    go.name += "1";
}

 

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案