mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
remove CachedFind
This commit is contained in:
parent
bb3b111358
commit
b72ef5b4cf
@ -21,7 +21,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
|
||||
if (info.isRaining)
|
||||
{
|
||||
var rainGO = GameObject.Instantiate(SearchUtilities.CachedFind("/GiantsDeep_Body/Sector_GD/Sector_GDInterior/Effects_GDInterior/Effects_GD_Rain"), effectsGO.transform);
|
||||
var rainGO = GameObject.Instantiate(SearchUtilities.Find("GiantsDeep_Body/Sector_GD/Sector_GDInterior/Effects_GDInterior/Effects_GD_Rain"), effectsGO.transform);
|
||||
rainGO.transform.position = planetGO.transform.position;
|
||||
|
||||
var pvc = rainGO.GetComponent<PlanetaryVectionController>();
|
||||
@ -44,7 +44,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
snowGO.transform.position = planetGO.transform.position;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
var snowEmitter = GameObject.Instantiate(SearchUtilities.CachedFind("/BrittleHollow_Body/Sector_BH/Effects_BH/Effects_BH_Snowflakes"), snowGO.transform);
|
||||
var snowEmitter = GameObject.Instantiate(SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Effects_BH/Effects_BH_Snowflakes"), snowGO.transform);
|
||||
snowEmitter.name = "SnowEmitter";
|
||||
snowEmitter.transform.position = planetGO.transform.position;
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
|
||||
Logger.Log($"Adding ship log astro object for {body.Config.name}");
|
||||
|
||||
GameObject unviewedReference = SearchUtilities.CachedFind(ShipLogHandler.PAN_ROOT_PATH + "/TimberHearth/UnviewedIcon");
|
||||
GameObject unviewedReference = SearchUtilities.Find(ShipLogHandler.PAN_ROOT_PATH + "/TimberHearth/UnviewedIcon");
|
||||
|
||||
ShipLogAstroObject astroObject = gameObject.AddComponent<ShipLogAstroObject>();
|
||||
astroObject._id = ShipLogHandler.GetAstroObjectId(body);
|
||||
@ -249,7 +249,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
}
|
||||
else if (Main.Instance.CurrentStarSystem == "SolarSystem")
|
||||
{
|
||||
GameObject gameObject = SearchUtilities.CachedFind(ShipLogHandler.PAN_ROOT_PATH + "/" + name);
|
||||
GameObject gameObject = SearchUtilities.Find(ShipLogHandler.PAN_ROOT_PATH + "/" + name);
|
||||
if (body.Config.destroy || (body.Config.ShipLog?.mapMode?.remove ?? false))
|
||||
{
|
||||
ShipLogAstroObject astroObject = gameObject.GetComponent<ShipLogAstroObject>();
|
||||
|
||||
@ -15,23 +15,6 @@ namespace NewHorizons.Utility
|
||||
CachedGameObjects.Clear();
|
||||
}
|
||||
|
||||
public static GameObject CachedFind(string path)
|
||||
{
|
||||
if (CachedGameObjects.ContainsKey(path))
|
||||
{
|
||||
return CachedGameObjects[path];
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObject foundObject = GameObject.Find(path);
|
||||
if (foundObject != null)
|
||||
{
|
||||
CachedGameObjects.Add(path, foundObject);
|
||||
}
|
||||
return foundObject;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<T> FindObjectsOfTypeAndName<T>(string name) where T : Object
|
||||
{
|
||||
T[] firstList = GameObject.FindObjectsOfType<T>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user