public override void OnLoad(ConfigNode node)
        {
            KCTDebug.Log("Reading from persistence.");
            base.OnLoad(node);
            KCT_DataStorage      kctVS = new KCT_DataStorage();
            KCT_BuildListStorage bls   = new KCT_BuildListStorage();
            KCT_TechStorage      tS    = new KCT_TechStorage();
            ConfigNode           CN    = node.GetNode(kctVS.GetType().Name);

            if (CN != null)
            {
                ConfigNode.LoadObjectFromConfig(kctVS, CN);
            }

            CN = node.GetNode(bls.GetType().Name);
            if (CN != null)
            {
                ConfigNode.LoadObjectFromConfig(bls, CN);
            }

            CN = node.GetNode(tS.GetType().Name);
            if (CN != null)
            {
                ConfigNode.LoadObjectFromConfig(tS, CN);
            }

            for (int i = 0; i < KCT_GameStates.VABList.Count; i++)
            {
                KCT_GameStates.VABList[i].shipNode = node.GetNode("VAB" + i);
            }
            for (int i = 0; i < KCT_GameStates.SPHList.Count; i++)
            {
                KCT_GameStates.SPHList[i].shipNode = node.GetNode("SPH" + i);
            }
            for (int i = 0; i < KCT_GameStates.VABWarehouse.Count; i++)
            {
                KCT_GameStates.VABWarehouse[i].shipNode = node.GetNode("VABWH" + i);
            }
            for (int i = 0; i < KCT_GameStates.SPHWarehouse.Count; i++)
            {
                KCT_GameStates.SPHWarehouse[i].shipNode = node.GetNode("SPHWH" + i);
            }
            for (int i = 0; i < KCT_GameStates.TechList.Count; i++)
            {
                KCT_GameStates.TechList[i].protoNode = new ProtoTechNode(node.GetNode("Tech" + i));
            }

            Kerbal_Construction_Time.DelayedStart();
        }
        public override void OnLoad(ConfigNode node)
        {
            Debug.Log("[KCT] Reading from persistence.");
            base.OnLoad(node);
            KCT_DataStorage kctVS = new KCT_DataStorage();
            KCT_BuildListStorage bls = new KCT_BuildListStorage();
            KCT_TechStorage tS = new KCT_TechStorage();
            ConfigNode CN = node.GetNode(kctVS.GetType().Name);
            if (CN != null)
                ConfigNode.LoadObjectFromConfig(kctVS, CN);

            CN = node.GetNode(bls.GetType().Name);
            if (CN != null)
                ConfigNode.LoadObjectFromConfig(bls, CN);

            CN = node.GetNode(tS.GetType().Name);
            if (CN != null)
                ConfigNode.LoadObjectFromConfig(tS, CN);

            for (int i = 0; i < KCT_GameStates.VABList.Count; i++)
            {
                KCT_GameStates.VABList[i].shipNode = node.GetNode("VAB" + i);
            }
            for (int i = 0; i < KCT_GameStates.SPHList.Count; i++)
            {
                KCT_GameStates.SPHList[i].shipNode = node.GetNode("SPH" + i);
            }
            for (int i = 0; i < KCT_GameStates.VABWarehouse.Count; i++)
            {
                KCT_GameStates.VABWarehouse[i].shipNode = node.GetNode("VABWH" + i);
            }
            for (int i = 0; i < KCT_GameStates.SPHWarehouse.Count; i++)
            {
                KCT_GameStates.SPHWarehouse[i].shipNode = node.GetNode("SPHWH" + i);
            }
            for (int i = 0; i < KCT_GameStates.TechList.Count; i++)
            {
                KCT_GameStates.TechList[i].protoNode = new ProtoTechNode(node.GetNode("Tech" + i));
            }

            KCT_GameStates.delayStart = true;
        }
        public override void OnSave(ConfigNode node)
        {
            Boolean error = false;

            KCTDebug.Log("Writing to persistence.");
            base.OnSave(node);
            KCT_DataStorage      kctVS = new KCT_DataStorage();
            KCT_BuildListStorage bls   = new KCT_BuildListStorage();
            KCT_TechStorage      tS    = new KCT_TechStorage();

            node.AddNode(kctVS.AsConfigNode());
            node.AddNode(bls.AsConfigNode());
            node.AddNode(tS.AsConfigNode());

            for (int i = 0; i < KCT_GameStates.VABList.Count; i++)
            {
                KCTDebug.Log("VAB" + i);
                ConfigNode CN = new ConfigNode();
                if (KCT_GameStates.VABList[i].shipNode != null)
                {
                    KCT_GameStates.VABList[i].shipNode.CopyTo(CN, "VAB" + i);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.LogError("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE VAB" + i);
                    error = true;
                }
            }
            for (int i = 0; i < KCT_GameStates.SPHList.Count; i++)
            {
                KCTDebug.Log("SPH" + i);
                ConfigNode CN = new ConfigNode();
                if (KCT_GameStates.SPHList[i].shipNode != null)
                {
                    KCT_GameStates.SPHList[i].shipNode.CopyTo(CN, "SPH" + i);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.LogError("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE SPH" + i);
                    error = true;
                }
            }
            for (int i = 0; i < KCT_GameStates.VABWarehouse.Count; i++)
            {
                KCTDebug.Log("VABWH" + i);
                ConfigNode CN = new ConfigNode();
                if (KCT_GameStates.VABWarehouse[i].shipNode != null)
                {
                    KCT_GameStates.VABWarehouse[i].shipNode.CopyTo(CN, "VABWH" + i);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.LogError("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE VABWH" + i);
                    error = true;
                }
            }
            for (int i = 0; i < KCT_GameStates.SPHWarehouse.Count; i++)
            {
                KCTDebug.Log("SPHWH" + i);
                ConfigNode CN = new ConfigNode();
                if (KCT_GameStates.SPHWarehouse[i].shipNode != null)
                {
                    KCT_GameStates.SPHWarehouse[i].shipNode.CopyTo(CN, "SPHWH" + i);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.LogError("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE SPHWH" + i);
                    error = true;
                }
            }
            for (int i = 0; i < KCT_GameStates.TechList.Count; i++)
            {
                KCTDebug.Log("Tech" + i);
                ConfigNode CN = new ConfigNode("Tech" + i);
                if (KCT_GameStates.TechList[i].protoNode != null)
                {
                    KCT_GameStates.TechList[i].protoNode.Save(CN);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.LogError("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE Tech" + i);
                    error = true;
                }
            }

            if (error)
            {
                //TODO: Popup with error message
            }
        }
        public override void OnSave(ConfigNode node)
        {
            Boolean error = false;
            Debug.Log("[KCT] Writing to persistence.");
            base.OnSave(node);
            KCT_DataStorage kctVS = new KCT_DataStorage();
            KCT_BuildListStorage bls = new KCT_BuildListStorage();
            KCT_TechStorage tS = new KCT_TechStorage();
            node.AddNode(kctVS.AsConfigNode());
            node.AddNode(bls.AsConfigNode());
            node.AddNode(tS.AsConfigNode());

            for (int i=0; i<KCT_GameStates.VABList.Count; i++)
            {
                Debug.Log("[KCT]: VAB"+i);
                ConfigNode CN = new ConfigNode();
                if (KCT_GameStates.VABList[i].shipNode != null)
                {
                    KCT_GameStates.VABList[i].shipNode.CopyTo(CN, "VAB" + i);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.Log("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE VAB" + i);
                    error = true;
                }
            }
            for (int i = 0; i < KCT_GameStates.SPHList.Count; i++)
            {
                Debug.Log("[KCT]: SPH" + i);
                ConfigNode CN = new ConfigNode();
                if (KCT_GameStates.SPHList[i].shipNode != null)
                {
                    KCT_GameStates.SPHList[i].shipNode.CopyTo(CN, "SPH" + i);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.Log("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE SPH" + i);
                    error = true;
                }
            }
            for (int i = 0; i < KCT_GameStates.VABWarehouse.Count; i++)
            {
                Debug.Log("[KCT]: VABWH" + i);
                ConfigNode CN = new ConfigNode();
                if (KCT_GameStates.VABWarehouse[i].shipNode != null)
                {
                    KCT_GameStates.VABWarehouse[i].shipNode.CopyTo(CN, "VABWH" + i);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.Log("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE VABWH" + i);
                    error = true;
                }
            }
            for (int i = 0; i < KCT_GameStates.SPHWarehouse.Count; i++)
            {
                Debug.Log("[KCT]: SPHWH" + i);
                ConfigNode CN = new ConfigNode();
                if (KCT_GameStates.SPHWarehouse[i].shipNode != null)
                {
                    KCT_GameStates.SPHWarehouse[i].shipNode.CopyTo(CN, "SPHWH" + i);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.Log("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE SPHWH" + i);
                    error = true;
                }
            }
            for (int i=0; i< KCT_GameStates.TechList.Count; i++)
            {
                Debug.Log("[KCT]: Tech" + i);
                ConfigNode CN = new ConfigNode("Tech"+i);
                if (KCT_GameStates.TechList[i].protoNode != null)
                {
                    KCT_GameStates.TechList[i].protoNode.Save(CN);
                    node.AddNode(CN);
                }
                else
                {
                    Debug.Log("[KCT] WARNING! DATA FAILURE EVENT ON CONFIGNODE Tech" + i);
                    error = true;
                }
            }

            if (error)
            {
                //TODO: Popup with error message
            }
        }