Пример #1
0
 public void PostZNS()
 {
     if (!PetManager.isInit)
     {
         PetManager.Init();
     }
     ValRegister();
 }
Пример #2
0
        private void Awake()
        {
            logger       = base.Logger;
            nexusID      = base.Config.Bind <int>("Nexus", "NexusID", 478, "Nexus mod ID for updates");
            HatchingTime = base.Config.Bind <int>("2DragonEgg", "hatching time", 300, "how long will egg become a drake");
            HatchingEgg  = base.Config.Bind <bool>("2DragonEgg", "enable egg hatching", true, "this alse enable tamed drake spawn eggs");
            cfg          = base.Config.Bind <string>("1General", "Settings",
                                                     "Hatchling,true,600,300,30,10,300,10,RawMeat,true,true,5,0.33,10,300",
                                                     "name,commandable,tamingTime,fedDuration,consumeRange,consumeSearchInterval,consumeHeal,consumeSearchRange,consumeItem:consumeItem,changeFaction,procretion,maxCreatures,pregnancyChance,pregnancyDuration,growTime,;next one;...;last one");

            loaded   = initCfg();
            CfgTable = new TameTable();
            string list = "Your list has: ";

            foreach (var item in cfgList.Keys)
            {
                list += item + "  ";
            }
            Root = new GameObject("AllTameable Root");

            prefabManager = Root.AddComponent <PrefabManager>();
            petManager    = Root.AddComponent <PetManager>();

            var SM_Root = new GameObject("ConfigManager").transform;

            SM_Root.SetParent(Plugin.Root.transform);
            SM_Root.gameObject.SetActive(false);
            configManager           = SM_Root.gameObject.AddComponent <ConfigManager>();
            configManager.debugInfo = list;
            configManager.obj       = CfgTable;
            configManager.title     = "All Tameable Setup " + (loaded ? "Loaded" : "!!Load Fail!!");
            //configManager.gameObject.SetActive(false);
            DontDestroyOnLoad(Root);

            Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), null);

            DBG.blogInfo("AllTameable Loadded");
        }