public static bool UpdateAFGName(string oName, string nName) { AFGInfo info = null; if (atmospheres.TryGetValue(oName, out info)) { atmospheres.Remove(oName); atmospheres[nName] = info; return(true); } return(false); }
public static bool PatchAFG(AtmosphereFromGround afg) { AFGInfo info = null; if (atmospheres.TryGetValue(afg.planet.bodyName, out info)) { try { info.Apply(afg); } catch { return(false); } return(true); } return(false); }
public void Update() { if (timeCounter < 0.5d) { timeCounter += Time.deltaTime; return; } foreach (AtmosphereFromGround afg in Resources.FindObjectsOfTypeAll <AtmosphereFromGround>()) { if (afg.planet != null) { //Debug.Log("[Kopernicus]: Patching AFG " + afg.planet.bodyName); //if (!AFGInfo.PatchAFG(afg)) // Debug.Log("[Kopernicus]: ERROR AtmosphereFixer => Couldn't patch AtmosphereFromGround for " + afg.planet.bodyName + "!"); if (AFGInfo.PatchAFG(afg)) { Debug.Log("[Kopernicus] AtmosphereFixer => Patched AtmosphereFromGround for " + afg.planet.bodyName); } } } UnityEngine.Object.Destroy(this); // don't hang around. }