void DeleteSprite(string sprite) { Debug.Log("DeleteSprite"); GameObject go = Instantiate(this.uiAtlas.gameObject); UIAtlas uia = go.GetComponent <UIAtlas>(); if (uia.HasSprite(sprite)) { uia.RemoveSprite(sprite); GameObject last = PrefabUtility.ReplacePrefab(go, uiAtlas, ReplacePrefabOptions.Default); this.uiAtlas = last.GetComponent <UIAtlas>(); } DestroyImmediate(go); }