Esempio n. 1
0
 private void SaveAtlasTextures(IReadOnlyList <AtlasTexture> textures)
 {
     TexturesProperty.arraySize = textures.Count;
     for (int i = 0; i < textures.Count; i++)
     {
         TexturesProperty.GetArrayElementAtIndex(i).objectReferenceValue = textures[i].Texture;
     }
 }
Esempio n. 2
0
 private void DeleteAtlasTextures()
 {
     for (int i = TexturesProperty.arraySize - 1; i >= 0; i--)
     {
         var texture = TexturesProperty.GetArrayElementAtIndex(i).objectReferenceValue;
         if (!texture)
         {
             continue;
         }
         AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(texture));
         UnityEngine.Object.DestroyImmediate(texture, true);
     }
     TexturesProperty.arraySize = 0;
 }