示例#1
0
        private void CommNetInit()
        {
            // create the vessel list now but wait for the real signal

            //			Debug.Log ("[AH][ShipListener] Commnet is initialized");
            AHShipList.ParseFlyingVessel();
        }
示例#2
0
        public void Start()
        {
            if (!HighLogic.CurrentGame.Parameters.CustomParams <AntennaHelperSettings> ().enableInEditor)
            {
                Destroy(this);
                return;
            }

            if (HighLogic.CurrentGame.Mode == Game.Modes.MISSION_BUILDER)
            {
                if (Component.FindObjectOfType <AHUtil> () == null)
                {
                    AHUtil util = gameObject.AddComponent <AHUtil> ();
                    util.Start();
                }

                AHShipList.UpdateLoadedGame();
                AHShipList.ParseFlyingVessel();
            }

            instance = this;

            trackingStationLevel = ScenarioUpgradeableFacilities.GetFacilityLevel(SpaceCenterFacility.TrackingStation);
            targetPower          = GameVariables.Instance.GetDSNRange(trackingStationLevel);
            targetName           = Localizer.Format("#autoLOC_AH_0015") + " " + (int)(trackingStationLevel * 2 + 1);

            GetShipList();

            GetAntennaPartList();

            CreateAntennaList();
            DoTheMath();

            GameEvents.onGUIApplicationLauncherReady.Add(AddToolbarButton);
            GameEvents.onGUIApplicationLauncherDestroyed.Add(RemoveToolbarButton);

            GameEvents.onEditorLoad.Add(VesselLoad);
            GameEvents.onEditorPartEvent.Add(PartEvent);
            GameEvents.onEditorPodPicked.Add(PodPicked);
            GameEvents.onEditorPodDeleted.Add(PodDeleted);

            GameEvents.onGameSceneSwitchRequested.Add(QuitEditor);
        }
示例#3
0
        private IEnumerator CommNetUpdateCoroutine()
        {
            inCoroutine = true;

            yield return(waitFor);

            while (!AHShipList.shipListReady)
            {
                yield return(waitFor);
            }

//			Debug.Log ("[AH] ship list is ready");

            if (listMarkers != null)
            {
                DestroyMarkers();
            }

            AHShipList.ParseFlyingVessel(true);
            GetListsShip();
            CreateMarkers();

            inCoroutine = false;
        }