com.wallstop-studios.unity-helpers 1.0.1-rc04 → 1.0.1-rc05

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.
@@ -9,7 +9,7 @@
9
9
  using Core.Helper;
10
10
  using UnityEngine;
11
11
  using UnityEditor;
12
- using Utils;
12
+ using UnityHelpers.Utils;
13
13
 
14
14
  // https://gist.githubusercontent.com/yujen/5e1cd78e2a341260b38029de08a449da/raw/ac60c1002e0e14375de5b2b0a167af00df3f74b4/SeniaAnimationEventEditor.cs
15
15
  public sealed class AnimationEventEditor : EditorWindow
@@ -7,7 +7,7 @@
7
7
  {
8
8
  private static T _instance;
9
9
 
10
- protected virtual bool DontDestroyOnLoad => true;
10
+ protected virtual bool Preserve => true;
11
11
 
12
12
  public static T Instance
13
13
  {
@@ -19,11 +19,11 @@
19
19
  }
20
20
 
21
21
  GameObject instance = new(typeof(T).Name + "Singleton", typeof(T));
22
- _ = instance.TryGetComponent(out _instance);
23
- if (_instance.DontDestroyOnLoad)
22
+ if (instance.TryGetComponent(out _instance) && _instance.Preserve)
24
23
  {
25
24
  DontDestroyOnLoad(instance);
26
25
  }
26
+
27
27
  return _instance;
28
28
  }
29
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.wallstop-studios.unity-helpers",
3
- "version": "1.0.1-rc04",
3
+ "version": "1.0.1-rc05",
4
4
  "displayName": "Unity Helpers",
5
5
  "description": "Various Unity Helper Library",
6
6
  "dependencies": {