com.wallstop-studios.unity-helpers 2.0.0-rc79.9 → 2.0.0-rc80.2
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.
|
@@ -17,6 +17,7 @@ namespace WallstopStudios.UnityHelpers.Editor.Sprites
|
|
|
17
17
|
Labels = 1 << 1,
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
[Flags]
|
|
20
21
|
public enum LabelSelectionMode
|
|
21
22
|
{
|
|
22
23
|
[Obsolete("Please select a valid value")]
|
|
@@ -25,6 +26,7 @@ namespace WallstopStudios.UnityHelpers.Editor.Sprites
|
|
|
25
26
|
AnyOf = 1 << 1,
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
[Flags]
|
|
28
30
|
public enum SpriteSelectionBooleanLogic
|
|
29
31
|
{
|
|
30
32
|
[Obsolete("Please select a valid value")]
|
|
@@ -142,6 +144,10 @@ namespace WallstopStudios.UnityHelpers.Editor.Sprites
|
|
|
142
144
|
[IntDropdown(0, 2, 4, 8, 16, 32)]
|
|
143
145
|
public int padding = 4;
|
|
144
146
|
|
|
147
|
+
public bool enableTightPacking = true;
|
|
148
|
+
|
|
149
|
+
public bool enableAlphaDilation = false;
|
|
150
|
+
|
|
145
151
|
[Tooltip(
|
|
146
152
|
"Enable Read/Write on the generated atlas texture. Needed for some runtime operations, but increases memory."
|
|
147
153
|
)]
|
|
@@ -782,6 +782,8 @@ namespace WallstopStudios.UnityHelpers.Editor.Sprites
|
|
|
782
782
|
SpriteAtlasPackingSettings packingSettings = atlas.GetPackingSettings();
|
|
783
783
|
packingSettings.enableRotation = config.enableRotation;
|
|
784
784
|
packingSettings.padding = config.padding;
|
|
785
|
+
packingSettings.enableTightPacking = config.enableTightPacking;
|
|
786
|
+
packingSettings.enableAlphaDilation = config.enableAlphaDilation;
|
|
785
787
|
atlas.SetPackingSettings(packingSettings);
|
|
786
788
|
|
|
787
789
|
SpriteAtlasTextureSettings textureSettings = atlas.GetTextureSettings();
|
|
@@ -5,6 +5,7 @@ namespace WallstopStudios.UnityHelpers.Utils
|
|
|
5
5
|
using System.Linq;
|
|
6
6
|
using Core.Extension;
|
|
7
7
|
using UnityEngine;
|
|
8
|
+
using UnityEngine.Serialization;
|
|
8
9
|
|
|
9
10
|
[Flags]
|
|
10
11
|
public enum ChildSpawnMethod
|
|
@@ -20,6 +21,10 @@ namespace WallstopStudios.UnityHelpers.Utils
|
|
|
20
21
|
{
|
|
21
22
|
private static readonly HashSet<GameObject> SpawnedPrefabs = new();
|
|
22
23
|
|
|
24
|
+
[FormerlySerializedAs("dontDestroyOnLoad")]
|
|
25
|
+
[SerializeField]
|
|
26
|
+
private bool _dontDestroyOnLoad = true;
|
|
27
|
+
|
|
23
28
|
[SerializeField]
|
|
24
29
|
private ChildSpawnMethod _spawnMethod = ChildSpawnMethod.Start;
|
|
25
30
|
|
|
@@ -58,6 +63,7 @@ namespace WallstopStudios.UnityHelpers.Utils
|
|
|
58
63
|
|
|
59
64
|
private void Spawn()
|
|
60
65
|
{
|
|
66
|
+
TrySetDontDestroyOnLoad();
|
|
61
67
|
if (
|
|
62
68
|
_prefabs
|
|
63
69
|
.Concat(_editorOnlyPrefabs)
|
|
@@ -133,5 +139,13 @@ namespace WallstopStudios.UnityHelpers.Utils
|
|
|
133
139
|
}
|
|
134
140
|
return child;
|
|
135
141
|
}
|
|
142
|
+
|
|
143
|
+
private void TrySetDontDestroyOnLoad()
|
|
144
|
+
{
|
|
145
|
+
if (_dontDestroyOnLoad && Application.isPlaying && !gameObject.IsDontDestroyOnLoad())
|
|
146
|
+
{
|
|
147
|
+
DontDestroyOnLoad(gameObject);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
136
150
|
}
|
|
137
151
|
}
|
package/package.json
CHANGED