TextureImporter ti = AssetImporter.GetAtPath (path) as TextureImporter; SpriteMetaData[] spriteSheet = ti.spritesheet; for (int i = 0; i < spriteSheet.Length; i++) {
if (spriteSheet[i].name.StartsWith ("Hydra_walk_")) { spriteSheet[i].rect = new Rect (spriteSheet[i].rect.x + 1, spriteSheet[i].rect.y + 1, spriteSheet[i].rect.width - 2, spriteSheet[i].rect.height - 2); } } ti.spritesheet = spriteSheet; EditorUtility.SetDirty (ti); ti.SaveAndReimport ();