#if UNITY_EDITOR

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEditor;

public class NameEditor : MonoBehaviour

{

    [MenuItem("Tools/Rename Sprites in Texture")]

    public static void RenameSprites()

    {

        string path = "Assets/Sprite/item/2_Cloth/Cloth_2.png";

        TextureImporter importer = AssetImporter.GetAtPath(path) as TextureImporter;


        if (importer != null && importer.spriteImportMode == SpriteImportMode.Multiple)

        {

            SpriteMetaData[] metas = importer.spritesheet;


            foreach (var meta in metas)

            {

                Debug.Log("Before: " + meta.name);

            }


            for (int i = 0; i < metas.Length; i++)

            {

                if (metas[i].name == "Right_A") metas[i].name = "_Right";

                if (metas[i].name == "Body_A") metas[i].name = "_Body";

                if (metas[i].name == "Left_A") metas[i].name = "_Left";

            }


            importer.spritesheet = metas;

            AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);

            AssetDatabase.Refresh();

        }

    }

}


#endif







경로는 확실해서 저렇게 반응이 있긴 한데

이름 자체는 안바뀜...

새로고침해봐도 똑같음