Beispiel #1
0
        public static void ComputeRealSignal(Vessel v)
        {
            //			yield return new WaitForSeconds (1f);
            //			Debug.Log ("[AH] Computing real signal for vessel : " + v.GetName ());
            if (listFlyingVessel.ContainsKey(v.id.ToString()))
            {
                //				Debug.Log ("[AH] " + v.GetName () + " is in the list");
                listFlyingVessel[v.id.ToString()]["connectedTo"] = "";
                if (v.Connection.IsConnected)
                {
                    listFlyingVessel[v.id.ToString()]["realSignal"] = AHUtil.GetRealSignalForTrackingStation(v.Connection.ControlPath).ToString();
                    if (!v.Connection.ControlPath[0].b.isHome)
                    {
                        listFlyingVessel[v.id.ToString()]["connectedTo"] = v.Connection.ControlPath[0].b.transform.GetComponent <Vessel>().id.ToString();
                    }
                }
                else
                {
                    listFlyingVessel[v.id.ToString()]["realSignal"] = "0";
                }

                //				Debug.Log ("[AH] its real signal = " + listFlyingVessel [v.id.ToString ()] ["realSignal"]);
            }
            else
            {
                //				Debug.Log ("[AH] " + v.GetName () + " is not in the list");
            }
            //			Debug.Log ("[AH] (Re-)Computing signal for vessel : " + v.GetName () + " : " + listFlyingVessel [v.id.ToString ()] ["realSignal"]);
        }
Beispiel #2
0
        public static void ComputeAllSignal()
        {
            Debug.Log("[AH] Computing real signal for all vessels");
            foreach (Vessel v in FlightGlobals.Vessels)
            {
                if (listFlyingVessel.ContainsKey(v.id.ToString()))
                {
                    listFlyingVessel[v.id.ToString()]["connectedTo"] = "";
                    listFlyingVessel[v.id.ToString()]["realSignal"]  = "0";

                    if (v.Connection.IsConnected)
                    {
                        listFlyingVessel[v.id.ToString()]["realSignal"] = AHUtil.GetRealSignalForTrackingStation(v.Connection.ControlPath).ToString();
                        if (!v.Connection.ControlPath[0].b.isHome)
                        {
                            listFlyingVessel[v.id.ToString()]["connectedTo"] = v.Connection.ControlPath[0].b.transform.GetComponent <Vessel>().id.ToString();
                        }
                    }
                    Debug.Log("[AH] " + v.GetName() + " is connected to " + listFlyingVessel[v.id.ToString()]["connectedTo"] + " with a signal of " + listFlyingVessel[v.id.ToString()]["realSignal"]);
                }
            }
        }