com.warwlock.mtree 1.0.4 → 1.0.6

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 CHANGED
@@ -5,7 +5,8 @@
5
5
  },
6
6
  "github": {
7
7
  "release": true,
8
- "releaseName": "v${version}"
8
+ "releaseName": "Release v${version}",
9
+ "tokenRef": "GITHUB_TOKEN"
9
10
  },
10
11
  "npm": {
11
12
  "publish": true
package/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ 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.6] - 2025-11-22
8
+
9
+ ### Fixed
10
+ - Better ambient occlusion for leaves and bark.
11
+
12
+ ## \[1.0.5] - 2025-11-22
13
+
14
+ ### Fixed
15
+ - Unity 6 "FindObjectByType" warnings were fixed.
16
+ - Removed some of old Unity version support codes.
17
+
7
18
  ## \[1.0.4] - 2025-11-22
8
19
 
9
20
  ### 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
- #else
30
- string prefabPath = AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabParent(instance));
31
- #endif
32
- MtreeComponent[] trees = (MtreeComponent[])GameObject.FindObjectsOfType(typeof(MtreeComponent));
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
- #if UNITY_2018_3_OR_NEWER
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
- #else
40
+ #else
40
41
  bool isInstance = PrefabUtility.GetPrefabType(tree) == PrefabType.PrefabInstance;
41
42
  string parentPrefabPath = AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabParent(tree));
42
- #endif
43
+ #endif
43
44
  if (isInstance && parentPrefabPath == prefabPath)
44
45
  {
45
- #if UNITY_2018_3_OR_NEWER
46
+ #if UNITY_2018_3_OR_NEWER
46
47
  PrefabUtility.UnpackPrefabInstance(tree.gameObject, PrefabUnpackMode.Completely, InteractionMode.AutomatedAction);
47
- #else
48
+ #else
48
49
  PrefabUtility.DisconnectPrefabInstance(tree);
49
- #endif
50
+ #endif
50
51
  originTree = tree;
51
52
  }
52
53
  }
53
54
 
54
55
 
55
- #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
+ #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
- #endif
59
+ #endif
59
60
 
60
61
  if (originTree == null)
61
62
  return;