复制行为树区分多次复制同一行为树

This commit is contained in:
MHW
2026-04-15 17:30:25 +08:00
parent 559a550157
commit b39a85a074
5 changed files with 37 additions and 1 deletions

View File

@@ -243,7 +243,14 @@ public class BehaviortreeProcessor {
String newEnglishName = englishName + "_" + behaviortree.getId();
behaviortree.setEnglishName(newEnglishName);
behaviortree.setName(newName);
//不做前置判断必走数据库count
//获取行为树重复名称个数
Integer num = behaviortreeService.getCountName(newName);
if(num > 0){
Integer count = num + 1;
newName += count;
newEnglishName += count;
}
return this.create(behaviortree);
}
}