private IEnumerator ParseOneVesselConnection(Vessel v) { isReady = false; AHShipList.shipListReady = false; yield return(new WaitForSeconds(.2f)); MapObject originalTarget = PlanetariumCamera.fetch.target; float originalDistance = PlanetariumCamera.fetch.Distance; PlanetariumCamera.fetch.SetTarget(v.mapObject); PlanetariumCamera.fetch.SetTarget(originalTarget); PlanetariumCamera.fetch.SetDistance(originalDistance); yield return(new WaitForSeconds(.2f)); AHShipList.ComputeRealSignal(v); AHShipList.shipListReady = true; isReady = true; }
private IEnumerator ParseVesselsConnection() { Dictionary <string, Dictionary <string, string> > ahShipList = AHShipList.GetShipList(false, true); List <Vessel> vesselList = FlightGlobals.Vessels.FindAll(v => ahShipList.ContainsKey(v.id.ToString())); // WaitForSeconds timer = new WaitForSeconds (.2f); yield return(new WaitForSeconds(.6f)); MapObject originalTarget = PlanetariumCamera.fetch.target; float originalDistance = PlanetariumCamera.fetch.Distance; foreach (Vessel v in vesselList) { PlanetariumCamera.fetch.SetTarget(v.mapObject); } PlanetariumCamera.fetch.SetTarget(originalTarget); PlanetariumCamera.fetch.SetDistance(originalDistance); yield return(new WaitForSeconds(.2f)); foreach (Vessel v in vesselList) { // Debug.Log ("[AH] Computing real signal for : " + v.GetName ()); AHShipList.ComputeRealSignal(v); } isReady = true; AHShipList.shipListReady = true; // Debug.Log ("[AH] shipList is now ready"); // foreach (KeyValuePair<string, Dictionary<string, string>> kvp in AHShipList.GetShipList (false, true)) { // Debug.Log ("[AH]"); // foreach (KeyValuePair<string, string> kvp2 in kvp.Value) { // Debug.Log ("[AH] " + kvp2.Key + " : " + kvp2.Value); // } // Debug.Log ("[AH]"); // } }