Skip to content

Commit 6969dd6

Browse files
committed
Fix for build breaking method in AssetUtils
1 parent 8e69a73 commit 6969dd6

4 files changed

Lines changed: 27 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
# [0.9.6-beta] - Dec 23, 2024
4+
- Removal of build breaking methods in AssetUtils
5+
36
# [0.9.5-beta] - Dec 22, 2024
47
- updated migration tools
58

Editor/Migration/StateMigrationTool.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#if UNITY_EDITOR
22
using System;
3+
using System.Collections.Generic;
34
using System.IO;
45
using System.Linq;
56
using Nonatomic.VSM2.StateGraph;
@@ -45,7 +46,7 @@ public static void Migrate()
4546

4647
private static void MigrateModels()
4748
{
48-
var models = AssetUtils.FindAllScriptableObjectsOfType<StateMachineModel>();
49+
var models = FindAllScriptableObjectsOfType<StateMachineModel>();
4950
foreach (var model in models)
5051
{
5152
StateMachineMigrator.Migrate(model);
@@ -124,6 +125,27 @@ private static void AddEnterAttribute(ref string fileContents)
124125
);
125126
}
126127
}
128+
129+
public static List<T> FindAllScriptableObjectsOfType<T>() where T : ScriptableObject
130+
{
131+
var guids = AssetDatabase.FindAssets($"t:{typeof(T).Name}");
132+
var results = new List<T>();
133+
134+
foreach (var guid in guids)
135+
{
136+
var path = AssetDatabase.GUIDToAssetPath(guid);
137+
var asset = AssetDatabase.LoadAssetAtPath<T>(path);
138+
139+
if (asset == null)
140+
{
141+
continue;
142+
}
143+
144+
results.Add(asset);
145+
}
146+
147+
return results.ToList();
148+
}
127149
}
128150
}
129151
#endif

Runtime/Utils/AssetUtils.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,6 @@ namespace Nonatomic.VSM2.Utils
88
{
99
public static class AssetUtils
1010
{
11-
public static List<T> FindAllScriptableObjectsOfType<T>() where T : ScriptableObject
12-
{
13-
var guids = AssetDatabase.FindAssets($"t:{typeof(T).Name}");
14-
var results = new List<T>();
15-
16-
foreach (var guid in guids)
17-
{
18-
var path = AssetDatabase.GUIDToAssetPath(guid);
19-
var asset = AssetDatabase.LoadAssetAtPath<T>(path);
20-
21-
if (asset == null)
22-
{
23-
continue;
24-
}
25-
26-
results.Add(asset);
27-
}
28-
29-
return results.ToList();
30-
}
31-
3211
public static List<Type> GetAllDerivedTypes<T>()
3312
{
3413
var derivedType = typeof(T);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.nonatomic.visualstatemachinev2",
3-
"version": "0.9.5-beta",
3+
"version": "0.9.6-beta",
44
"displayName": "Visual State Machine V2",
55
"description": "Visual State Machine V2\n\nIMPORTANT NOTE: If you are upgrading to 0.9.0-beta and above from earlier versions, note that `OnEnter` methods now require an `[Enter]` attribute and that the base `OnEnter` method is no longer abstract but virtual.",
66
"unity": "2022.3",

0 commit comments

Comments
 (0)