Exemplo n.º 1
0
        private void ParseWidgetContainer()
        {
            int count = _TrackingStation.listContainer.childCount;

            for (int i = _TrackingStation.listContainer.childCount - 1; i >= 0; i--)
            {
                Transform t = _TrackingStation.listContainer.GetChild(i);

                TrackingStationWidget widget = t.GetComponent <TrackingStationWidget>();

                if (widget != null && widget.vessel != null)
                {
                    _TrackedVesselWidgets.Add(widget);

                    if (!_VesselManeuvers.ContainsKey(widget.vessel))
                    {
                        bool maneuver = false;

                        double time = Vessel.GetNextManeuverTime(widget.vessel, out maneuver);

                        if (maneuver)
                        {
                            _VesselManeuvers.Add(widget.vessel, time);
                        }
                        else
                        {
                            _VesselManeuvers.Add(widget.vessel, -1000000000);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void UpdateInterestedVessels()
        {
            List <Vessel> allVessels = FlightGlobals.Vessels;

            for (int i = 0; i < allVessels.Count; i++)
            {
                if (allVessels[i].loaded)
                {
                    RemoveInterestedVessel(allVessels[i].protoVessel);
                }
                else if (!allVessels[i].loaded && !InterestedVessels.ContainsKey(allVessels[i].protoVessel))
                {
                    if (InterestedVessel.ContainsInterestedModules(allVessels[i].protoVessel))
                    {
                        AddInterestedVessel(allVessels[i].protoVessel);
                    }
                }
            }
        }