mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
add a final warn in Find lol
This commit is contained in:
parent
2ef5582c83
commit
c444b6fdb2
@ -105,7 +105,7 @@ namespace NewHorizons.Utility
|
||||
var root = SceneManager.GetActiveScene().GetRootGameObjects().FirstOrDefault(x => x.name == rootName);
|
||||
if (root == null)
|
||||
{
|
||||
if (warn) Logger.LogWarning($"Couldn't find root object in path ({path})");
|
||||
if (warn) Logger.LogWarning($"Couldn't find root object in path {path}");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -114,11 +114,15 @@ namespace NewHorizons.Utility
|
||||
if (go == null)
|
||||
{
|
||||
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}");
|
||||
// find resource to include inactive objects
|
||||
// also includes prefabs but hopefully thats okay
|
||||
go = FindResourceOfTypeAndName<GameObject>(name);
|
||||
if (go == null) return null;
|
||||
if (go == null)
|
||||
{
|
||||
if (warn) Logger.LogWarning($"Couldn't find object with name {name}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user