fix find again by not including prefabs

This commit is contained in:
JohnCorby 2022-09-02 21:21:40 -07:00
parent e874f5b012
commit 680314645d

View File

@ -119,9 +119,9 @@ namespace NewHorizons.Utility
var name = names.Last(); var name = names.Last();
if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}"); if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}");
// 3: find resource to include inactive objects // 3: find resource to include inactive objects (but skip prefabs
// also includes prefabs but hopefully thats okay go = Resources.FindObjectsOfTypeAll<GameObject>()
go = FindResourceOfTypeAndName<GameObject>(name); .FirstOrDefault(x => x.scene.name != null && x.name == name);
if (go) if (go)
{ {
CachedGameObjects.Add(path, go); CachedGameObjects.Add(path, go);