com.warwlock.mtree 1.0.4 → 1.0.5
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/.release-it.json +2 -1
- package/CHANGELOG.md +6 -0
- package/Editor/EditorCallbacks.cs +14 -13
- package/package.json +1 -1
package/.release-it.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## \[1.0.5] - 2025-11-22
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- Unity 6 "FindObjectByType" warnings were fixed.
|
|
11
|
+
- Removed some of old Unity version support codes.
|
|
12
|
+
|
|
7
13
|
## \[1.0.4] - 2025-11-22
|
|
8
14
|
|
|
9
15
|
### Removed
|
|
@@ -24,38 +24,39 @@ namespace Mtree
|
|
|
24
24
|
if (instance.GetComponent<MtreeComponent>() == null)
|
|
25
25
|
return;
|
|
26
26
|
|
|
27
|
-
#if UNITY_2018_3_OR_NEWER
|
|
28
27
|
string prefabPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(instance);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
MtreeComponent[] trees =
|
|
29
|
+
#if UNITY_6000_0_OR_NEWER
|
|
30
|
+
(MtreeComponent[])GameObject.FindObjectsByType(typeof(MtreeComponent), FindObjectsSortMode.None);
|
|
31
|
+
#else
|
|
32
|
+
(MtreeComponent[])GameObject.FindObjectsOfType(typeof(MtreeComponent));
|
|
33
|
+
#endif
|
|
33
34
|
MtreeComponent originTree = null;
|
|
34
35
|
foreach (MtreeComponent tree in trees)
|
|
35
36
|
{
|
|
36
|
-
|
|
37
|
+
#if UNITY_2018_3_OR_NEWER
|
|
37
38
|
bool isInstance = PrefabUtility.GetPrefabInstanceStatus(tree) == PrefabInstanceStatus.Connected;
|
|
38
39
|
string parentPrefabPath = AssetDatabase.GetAssetPath(PrefabUtility.GetCorrespondingObjectFromSource(tree));
|
|
39
|
-
|
|
40
|
+
#else
|
|
40
41
|
bool isInstance = PrefabUtility.GetPrefabType(tree) == PrefabType.PrefabInstance;
|
|
41
42
|
string parentPrefabPath = AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabParent(tree));
|
|
42
|
-
|
|
43
|
+
#endif
|
|
43
44
|
if (isInstance && parentPrefabPath == prefabPath)
|
|
44
45
|
{
|
|
45
|
-
|
|
46
|
+
#if UNITY_2018_3_OR_NEWER
|
|
46
47
|
PrefabUtility.UnpackPrefabInstance(tree.gameObject, PrefabUnpackMode.Completely, InteractionMode.AutomatedAction);
|
|
47
|
-
|
|
48
|
+
#else
|
|
48
49
|
PrefabUtility.DisconnectPrefabInstance(tree);
|
|
49
|
-
|
|
50
|
+
#endif
|
|
50
51
|
originTree = tree;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
#if UNITY_2018_3_OR_NEWER // Unity 2017 crashes when deleting prefab at this stage. This part is therefore also done in the MtreeComponent editor
|
|
56
57
|
AssetDatabase.DeleteAsset(prefabPath);
|
|
57
58
|
AssetDatabase.Refresh();
|
|
58
|
-
|
|
59
|
+
#endif
|
|
59
60
|
|
|
60
61
|
if (originTree == null)
|
|
61
62
|
return;
|
package/package.json
CHANGED