hi all,
well i’ve been trying to find the awnser, but didn´t find it… so i’m posting here, well:
what i want is to change the name of an object in the hierarchy,
for example, i have many cubes with the same name, and i need to change every single cube’s name to another distinctive name and save it, so after i end the play session i have every cube with different names.
i only need the code to change one,
is there any function that lets me do this?
thanks in advance 
You’ll probably need to use an editor script for this. For some examples, check out the ‘editor scripts’ section of the script wiki. (Sorry, don’t have a link handy at the moment.)
anyone?
i alrealdy searched everything in the wiki section and in the unity script reference and didn’t find anything, and what i found doesn’t work…
I don’t know that you’re going to find a script that does exactly what you’re wanting. You might, but it’s more likely you’ll need to write it yourself. (If you’re running into problems with that you can always post your code here along with a description of the problem, and someone should be able to help.)
the “problem” that i’m having is that when i end the play session, all names come back to the original… (i know why it happens)
i know there isn’t a script, what i’m looking for is a function that changes the name of the object permanently, so i dont have to change every single one manually, the rest i know what and how to do xD
To change the name of a game object, you can simply assign a new value to the ‘name’ property, e.g.:
go.name = "name";
It’s been a while since I’ve done any editor scripting, but if I’m not mistaken, if this change is made via an editor script while in edit mode (as opposed to play mode), the change should be ‘permanent’ (provided it’s saved with the scene at some point).
A reasonable way to invoke this code would probably be via a menu command, which the ‘extending the editor’ portion of the documentation or the script wiki should show you how to do. From there, you’ll probably want to find all the objects of interest by name, tag, type, or selection (whichever is appropriate), and then assign new names as desired.
Again, it’s been a while since I’ve worked with the editor in this way, but I think the above will work. (If not though, perhaps someone else will provide an alternate solution.)
thanks,
i’ll try that
i’ll let you know if it works
just wanted to say that it’s resolved,
thanks for your help 
here’s what i needed to do : ( changing every children’s name in an object)
@script ExecuteInEditMode()
function Start () {
for (var Children : Transform in transform){
Children.name = Children.name + Random.Range ( -10.000, 10.000);
}
}
really simple
soon i’ll reveal what i am going to release on the asset store
i think it’s going to be very usefull to many people