0

I have some Unity editor integration scripts with that the user should be able to create game objects in the opened scene and I'd like to be able to automatically give each newly created object a unique, preferably sequentially numbered name, e.g.

Actor001
Actor002
Actor003
...
Actor100
etc.

So I was wondering if there are any useful methods known already or whether I have to implement this behavior myself completely, in which case I'm wondering how to figure out the sequence numbering from already existing objects. Any Ideas?

BadmintonCat
  • 9,416
  • 14
  • 78
  • 129

1 Answers1

4

Found it:

GameObjectUtility.GetUniqueNameForSibling(parent, name);
BadmintonCat
  • 9,416
  • 14
  • 78
  • 129