示例#1
0
        public override void OnSave(ConfigNode config)
        {
            ProgenySettings.Save(config);
            var id = bit_reverse(grey(zygote_id));

            config.AddValue("zygote_id", id);

            foreach (var embryo in embryos.Values)
            {
                var node = config.AddNode("embryo");
                embryo.Save(node);
            }

            foreach (var juvenile in juveniles.Values)
            {
                var node = config.AddNode("juvenile");
                juvenile.Save(node);
            }

            foreach (var female in females.Values)
            {
                var node = config.AddNode("female");
                female.Save(node);
            }

            foreach (var male in males.Values)
            {
                var node = config.AddNode("male");
                male.Save(node);
            }
        }
示例#2
0
        public override void OnLoad(ConfigNode config)
        {
            Debug.Log("[ProgenyScenario] OnLoad");
            ProgenySettings.Load(config);
            var  ids = config.GetValue("zygote_id");
            uint id  = 0;

            uint.TryParse(ids, out id);
            zygote_id = rgrey(bit_reverse(id));

            StartCoroutine(WaitAndLoadProgeny(config));
        }