com.wallstop-studios.unity-helpers 1.0.1-rc04 → 1.0.1-rc06
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.
- package/Editor/AnimationEventEditor.cs +1 -1
- package/Editor/WallstopStudios.UnityHelpers.Editor.asmdef +3 -1
- package/Runtime/Utils/RuntimeSingleton.cs +3 -3
- package/package.json +1 -1
- package/Tests/Editor/WallstopStudios.UnityHelpers.Tests.Editor.asmdef +0 -17
- package/Tests/Editor/WallstopStudios.UnityHelpers.Tests.Editor.asmdef.meta +0 -7
- package/Tests/Editor.meta +0 -8
|
@@ -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
|
|
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
|
-
|
|
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,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "WallstopStudios.UnityHelpers.Tests.Editor",
|
|
3
|
-
"rootNamespace": "",
|
|
4
|
-
"references": [
|
|
5
|
-
"UnityEditor.TestRunner",
|
|
6
|
-
"UnityEngine.TestRunner"
|
|
7
|
-
],
|
|
8
|
-
"includePlatforms": [],
|
|
9
|
-
"excludePlatforms": [],
|
|
10
|
-
"allowUnsafeCode": false,
|
|
11
|
-
"overrideReferences": false,
|
|
12
|
-
"precompiledReferences": [],
|
|
13
|
-
"autoReferenced": true,
|
|
14
|
-
"defineConstraints": [],
|
|
15
|
-
"versionDefines": [],
|
|
16
|
-
"noEngineReferences": false
|
|
17
|
-
}
|