コード例 #1
0
        public void Awake()
        {
            //Get root path
            ConfigRootPath = Config.ConfigFilePath;
            ConfigRootPath = ConfigRootPath.Remove(Config.ConfigFilePath.Count() - "PVP.cfg".Length);

            /*Compatibility*/

            /*API Extenstions*/
            VoteAPI.SetHook();
            /*Mod menu options*/
            Hooks.Init();
        }
コード例 #2
0
 void ModSetup(Scene scene, LoadSceneMode loadSceneMode)
 {
     if (scene.name == "title")
     {
         if (BodyCatalog.availability.available &&
             ItemCatalog.availability.available &&
             EquipmentCatalog.availability.available)
         {
             /*Loads Config Settings*/
             Settings.LoadConfig(Config);
             Settings.LoadCustomPlayableCharactersConfig(ConfigRootPath + "PVPCustomPlayableCharacters.cfg");
             Settings.LoadBannedItemListConfig(ConfigRootPath + "PVPBannedItemList.cfg");
             Settings.LoadCustomInteractablesSpawnerConfig(new ConfigFile(ConfigRootPath + "PVPCustomInteractablesSpawner.cfg", true));
             /*Setup*/
             Hooks.SetupHook();
             Debug.Log("RoR2PVP mod setup completed");
         }
         else
         {
             Debug.LogError("Failed to load RoR2PVP mod, please let the developer know on \"https://github.com/tung362/RoR2PVP/issues\"");
         }
         SceneManager.sceneLoaded -= ModSetup;
     }
 }