Remove all proxies bc they suck

This commit is contained in:
Nick 2022-03-20 21:10:35 -04:00
parent a1e84d8152
commit 47585783c3
2 changed files with 10 additions and 2 deletions

View File

@ -211,9 +211,14 @@ namespace NewHorizons.Builder.General
HeavenlyBodyBuilder.Remove(ao);
}
public static void RemoveDistantProxyClones()
public static void RemoveAllProxies()
{
GameObject.Destroy(GameObject.FindObjectOfType<DistantProxyManager>().gameObject);
foreach(var name in _solarSystemBodies)
{
RemoveProxy(name.Replace(" ", "").Replace("'", ""));
}
}
private static void DisableBody(GameObject go, bool delete)
@ -233,6 +238,9 @@ namespace NewHorizons.Builder.General
if (distantProxy != null) GameObject.Destroy(distantProxy.gameObject);
if (distantProxyClone != null) GameObject.Destroy(distantProxyClone.gameObject);
if (distantProxy == null && distantProxyClone == null)
Logger.Log($"Couldn't find proxy for {name}");
}
}
}

View File

@ -102,7 +102,7 @@ namespace NewHorizons.Handlers
Logger.Log("Done loading bodies");
// I don't know what these do but they look really weird from a distance
Main.Instance.ModHelper.Events.Unity.FireInNUpdates(() => PlanetDestroyer.RemoveDistantProxyClones(), 1);
Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(PlanetDestroyer.RemoveAllProxies);
if (Main.Instance.CurrentStarSystem != "SolarSystem") PlanetDestroyer.RemoveSolarSystem();
}