Esempio n. 1
0
        public override void OnLoad(ConfigNode node)
        {
            if (!GameSceneFilter.AnyInitializing.IsLoaded())
            {
                return;
            }

            tankTypeOptions = new List <TankTypeOption>();
            foreach (ConfigNode optNode in node.GetNodes("TANK_TYPE_OPTION"))
            {
                TankTypeOption option = new TankTypeOption();
                option.Load(optNode);
                tankTypeOptions.Add(option);
            }

            // Unity for some daft reason, and not as according to it's own documentation, won't clone
            // serializable member fields. Lets DIY.
            tankTypeOptionsSerialized = ObjectSerializer.Serialize(tankTypeOptions);


            try
            {
                if (bool.Parse(node.GetValue("useVolume")))
                {
                    tankVolumeName = PartVolumes.Tankage.ToString();
                }
            }
            // ReSharper disable once EmptyGeneralCatchClause
            catch { }
        }
Esempio n. 2
0
        private void LoadTechLimits(ConfigNode node)
        {
            List <TechLimit> techLimits = new List <TechLimit>();

            foreach (ConfigNode tNode in node.GetNodes("TECHLIMIT"))
            {
                TechLimit limit = new TechLimit();
                limit.Load(tNode);
                techLimits.Add(limit);
            }
            if (techLimits.Count == 0)
            {
                return;
            }

            techLimitsSerialized = ObjectSerializer.Serialize(techLimits);
        }
Esempio n. 3
0
        public override void OnLoad(ConfigNode node)
        {
            if (!GameSceneFilter.AnyInitializing.IsLoaded())
            {
                return;
            }

            tankTypeOptions = new List <TankTypeOption>();
            foreach (ConfigNode optNode in node.GetNodes("TANK_TYPE_OPTION"))
            {
                TankTypeOption option = new TankTypeOption();
                option.Load(optNode);
                tankTypeOptions.Add(option);
            }

            // Unity for some daft reason, and not as according to it's own documentation, won't clone
            // serializable member fields. Lets DIY.
            tankTypeOptionsSerialized = ObjectSerializer.Serialize(tankTypeOptions);
        }