Skip to content

Commit

Permalink
Bug fix on after migration
Browse files Browse the repository at this point in the history
  • Loading branch information
JLChnToZ committed Apr 20, 2024
1 parent 642e02a commit 4a57445
Show file tree
Hide file tree
Showing 9 changed files with 2,675 additions and 57 deletions.
5 changes: 3 additions & 2 deletions Packages/idv.jlchntoz.vvmw/Editor/Common/TMProMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ public static void LoadFontMapping() {
}

public static void Migrate(GameObject root) {
var monoBehaviours = root.GetComponentsInChildren<MonoBehaviour>(true);
var migratableTypes = new Dictionary<Type, bool>();
var migratableFields = new Dictionary<Type, Dictionary<FieldInfo, FieldInfo>>();
foreach (var monoBehaviour in monoBehaviours) {
foreach (var monoBehaviour in root.GetComponentsInChildren<MonoBehaviour>(true)) {
var type = monoBehaviour.GetType();
if (!migratableTypes.TryGetValue(type, out var isTypeMigratable))
migratableTypes[type] = isTypeMigratable = type.GetCustomAttribute<TMProMigratableAttribute>() != null;
Expand Down Expand Up @@ -67,6 +66,8 @@ public static void Migrate(GameObject root) {
}
}
}
foreach (var text in root.GetComponentsInChildren<Text>(true))
Migrate(text);
}

public static TextMeshProUGUI Migrate(Text textComponent) {
Expand Down
Loading

0 comments on commit 4a57445

Please sign in to comment.