Exemplo n.º 1
0
        protected override void Start()
        {
            base.Start();
            if (!(HighLogic.LoadedSceneIsFlight || HighLogic.LoadedScene == GameScenes.TRACKSTATION))
            {
                return;
            }
            Debug.Log($"[RACN UI] Start() in {HighLogic.LoadedScene}");
            configWindow        = gameObject.AddComponent <NetUIConfigurationWindow>();
            configWindow.parent = this;

            if (MapView.fetch is MapView map)
            {
                Texture2D defaultTex = GameDatabase.Instance.GetTexture(icon, false);
                foreach (RACommNetHome home in GameObject.FindObjectsOfType <RACommNetHome>())
                {
                    MapUI.GroundStationSiteNode gs = new MapUI.GroundStationSiteNode(home.Comm as RACommNode);
                    SiteNode  siteNode             = SiteNode.Spawn(gs);
                    Texture2D stationTexture       = (GameDatabase.Instance.GetTexture(home.icon, false) is Texture2D tex) ? tex : defaultTex;
                    siteNode.wayPoint.node.SetIcon(Sprite.Create(stationTexture, new Rect(0, 0, stationTexture.width, stationTexture.height), new Vector2(0.5f, 0.5f), 100f));
                    //                    MapView.fetch.siteNodes.Add(SiteNode.Spawn(gs));
                }

//                RAOrbitRenderer.ReplaceOrbitRenderers();
            }
            RATelemetryUpdate.Install();
        }
Exemplo n.º 2
0
        protected override void Start()
        {
            base.Start();
            if (!(HighLogic.LoadedSceneIsFlight || HighLogic.LoadedScene == GameScenes.TRACKSTATION))
            {
                return;
            }

            if (MapView.fetch is MapView)
            {
                Texture2D defaultTex = GameDatabase.Instance.GetTexture(icon, false);
                foreach (RACommNetHome home in FindObjectsOfType <RACommNetHome>())
                {
                    MapUI.GroundStationSiteNode gs = new MapUI.GroundStationSiteNode(home.Comm);
                    SiteNode  siteNode             = SiteNode.Spawn(gs);
                    Texture2D stationTexture       = (GameDatabase.Instance.GetTexture(home.icon, false) is Texture2D tex) ? tex : defaultTex;
                    siteNode.wayPoint.node.SetIcon(Sprite.Create(stationTexture, new Rect(0, 0, stationTexture.width, stationTexture.height), new Vector2(0.5f, 0.5f), 100f));
                    siteNode.wayPoint.node.OnUpdateVisible += home.OnUpdateVisible;
                }
            }
            RATelemetryUpdate.Install();
        }