Beispiel #1
0
        protected override void Start()
        {
            if (Features.KCommNet)
            {
                Instance = this;
                Cache.InitGroundStation();
                Cache.refreshCommNode = true;

                Lib.Debug("KCommNet Scenario loading ...");
                //Replace the CommNet user interface
                CommNetUI ui = FindObjectOfType <CommNetUI>();
                CustomCommNetUI = gameObject.AddComponent <KCommNetUI>();
                Destroy(ui);

                //Replace the CommNet network
                CommNetNetwork net = FindObjectOfType <CommNetNetwork>();
                CustomCommNetNetwork = gameObject.AddComponent <KCommNetNetwork>();
                Destroy(net);

                //Replace the CommNet ground stations
                CommNetHome[] homes = FindObjectsOfType <CommNetHome>();
                for (int i = 0; i < homes.Length; i++)
                {
                    KCommNetHome customHome = homes[i].gameObject.AddComponent(typeof(KCommNetHome)) as KCommNetHome;
                    customHome.CopyOf(homes[i]);
                    Destroy(homes[i]);
                    //DB.Station(customHome.nodeName);
                    Cache.LoadGroundStation(customHome);
                }

                //Replace the CommNet celestial bodies
                CommNetBody[] bodies = FindObjectsOfType <CommNetBody>();
                for (int i = 0; i < bodies.Length; i++)
                {
                    KCommNetBody customBody = bodies[i].gameObject.AddComponent(typeof(KCommNetBody)) as KCommNetBody;
                    customBody.CopyOf(bodies[i]);
                    Destroy(bodies[i]);
                }
                Lib.Verbose("CommNet Scenario loading done!");
            }
        }
 public static void LoadGroundStation(KCommNetHome station) => groundStations.Add(station);