bulkRenamer.cs 618 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using EasyButtons;
  5. public class bulkRenamer : MonoBehaviour
  6. {
  7. public string find;
  8. public string replace;
  9. [Button]
  10. public void Rename(){
  11. foreach(Transform t in transform.GetComponentsInChildren<Transform>()){
  12. if(t.name.Contains(find)){
  13. t.name = t.name.Replace(find,replace);
  14. }
  15. }
  16. Debug.Log("It works!");
  17. }
  18. void Start()
  19. {
  20. }
  21. // Update is called once per frame
  22. void Update()
  23. {
  24. }
  25. }