find AstroObject instead of GameObject to hopefully not be as slow

This commit is contained in:
JohnCorby 2022-05-22 13:09:58 -07:00
parent d2009f7637
commit 2094ef711f

View File

@ -132,7 +132,9 @@ namespace NewHorizons.Utility
if (primary._customName.Equals("Sun Station")) if (primary._customName.Equals("Sun Station"))
{ {
// there are multiple debris with the same name // there are multiple debris with the same name
otherChildren.AddRange(GameObject.FindObjectsOfType<GameObject>().Where(x => x.name == "SS_Debris_Body")); otherChildren.AddRange(Object.FindObjectsOfType<AstroObject>()
.Select(x => x.gameObject)
.Where(x => x.name == "SS_Debris_Body"));
} }
break; break;
default: default: