com.wallstop-studios.unity-helpers 2.0.0-rc81.5 → 2.0.0-rc81.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -161,6 +161,18 @@ namespace WallstopStudios.UnityHelpers.Editor.Sprites
161
161
  public int crunchCompressionLevel = 50;
162
162
 
163
163
  public TextureImporterCompression compression = TextureImporterCompression.Compressed;
164
+
165
+ private void OnValidate()
166
+ {
167
+ if (!Application.isPlaying)
168
+ {
169
+ int removed = spritesToPack.RemoveAll(sprite => sprite == null);
170
+ if (removed > 0)
171
+ {
172
+ EditorUtility.SetDirty(this);
173
+ }
174
+ }
175
+ }
164
176
  }
165
177
  #endif
166
178
  }
@@ -830,9 +830,15 @@ namespace WallstopStudios.UnityHelpers.Editor.Sprites
830
830
  atlas.Remove(toRemove.ToArray<Object>());
831
831
  }
832
832
 
833
- Object[] spritesToAdd = config.spritesToPack.Where(s => s != null).ToArray<Object>();
834
- if (spritesToAdd.Length > 0)
833
+ int removed = config.spritesToPack.RemoveAll(sprite => sprite == null);
834
+ if (removed > 0)
835
835
  {
836
+ EditorUtility.SetDirty(config);
837
+ }
838
+
839
+ if (config.spritesToPack.Count > 0)
840
+ {
841
+ Object[] spritesToAdd = config.spritesToPack.ToArray<Object>();
836
842
  atlas.Add(spritesToAdd);
837
843
  }
838
844
  else
@@ -857,7 +863,7 @@ namespace WallstopStudios.UnityHelpers.Editor.Sprites
857
863
  AssetDatabase.Refresh();
858
864
  }
859
865
  this.Log(
860
- $"'{config.name}': Successfully generated/updated at {outputPath}. Sprites included: {spritesToAdd.Length}."
866
+ $"'{config.name}': Successfully generated/updated at {outputPath}. Sprites included: {config.spritesToPack.Count}."
861
867
  );
862
868
  }
863
869
 
@@ -60,6 +60,7 @@ namespace WallstopStudios.UnityHelpers.Utils
60
60
 
61
61
  if (Preserve && Application.isPlaying)
62
62
  {
63
+ transform.SetParent(null, worldPositionStays: false);
63
64
  DontDestroyOnLoad(gameObject);
64
65
  }
65
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.wallstop-studios.unity-helpers",
3
- "version": "2.0.0-rc81.5",
3
+ "version": "2.0.0-rc81.7",
4
4
  "displayName": "Unity Helpers",
5
5
  "description": "Various Unity Helper Library",
6
6
  "dependencies": {},