Hello,
I’m wondering is there an idle console that’s available to run commands for any custom tools to help my workflow? For example, if I wanted to batch rename some objects in a scene via script without having to manually do it.
Hope that makes sense!
Not exactly what I was after, but at least this does interact with the scene. After creating a new c# script, here’s a basic example to batch rename selected objects.
using UnityEngine;
using UnityEditor;
using System.Collections;
public class WindowExample : EditorWindow {
[MenuItem ("Window/Batch renamer")]
public static void ShowWindow()
{
EditorWindow.GetWindow(typeof(WindowExample));
}
void OnGUI()
{
if(GUILayout.Button("Rename selected objects"))
{
GameObject[] objs = Selection.gameObjects;
Undo.RecordObjects(objs, "Rename selection");
for (int i = 0; i < objs.Length; i++)
{
objs*.name = string.Concat("newName_", i+1);*
}
}
}
}