Ejemplo n.º 1
0
        public static void Initialize()
        {
            try
            {
                ModSettings.DifficultyChoosen = false;
                if (SceneManager.GetActiveScene().name == "TitleScene")
                {
                    new GameObject("Resource Manager").AddComponent <Res.ResourceLoader>();
                    Res.ResourceLoader.InMainMenu = true;
                }
                else
                {
                    Res.ResourceLoader.InMainMenu = false;

                    new GameObject("NetworkManagerObj").AddComponent <Network.NetworkManager>();
                    GameObject go = new GameObject("Playerobj");
                    go.AddComponent <ModdedPlayer>();
                    go.AddComponent <Inventory>();
                    go.AddComponent <ModReferences>();
                    go.AddComponent <SpellCaster>();
                    go.AddComponent <ClinetItemPicker>();
                    go.AddComponent <MeteorSpawner>();
                    BuffDB.FillBuffList();
                    ItemDataBase.Initialize();
                    SpellDataBase.Initialize();
                    EnemyManager.Initialize();
                    new GameObject("MainMenuObj").AddComponent <MainMenu>();
                    Network.NetworkManager.instance.onGetMessage += Network.CommandReader.OnCommand;
                    Res.Buildings.InitBuildings();
                    Perk.FillPerkList();
                }
            }
            catch (Exception ex)
            {
                ModAPI.Log.Write(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public static void Initialize()
        {
            try
            {
                ModSettings.Version = ModAPI.Mods.LoadedMods["ChampionsOfForest"].Version;

                if (SteamDSConfig.isDedicated)
                {
                    ModAPI.Log.Write("isDedicated true");
                    ModSettings.IsDedicated = true;
                }

                if (ModSettings.IsDedicated)
                {
                    ReadDediServerConfig();



                    new GameObject("NetworkManagerObj").AddComponent <Network.NetworkManager>();
                    GameObject go = new GameObject("Playerobj");
                    //go.AddComponent<ModdedPlayer>();
                    //go.AddComponent<Inventory>();
                    go.AddComponent <ModReferences>();
                    //go.AddComponent<SpellCaster>();
                    //go.AddComponent<ClinetItemPicker>();
                    //go.AddComponent<MeteorSpawner>();
                    //BuffDB.FillBuffList();
                    ItemDataBase.Initialize();
                    //SpellDataBase.Initialize();
                    EnemyManager.Initialize();
                    //new GameObject("MainMenuObj").AddComponent<MainMenu>();
                    Network.NetworkManager.instance.onGetMessage += Network.CommandReader.OnCommand;
                    //Res.Buildings.InitBuildings();
                    ExpEvents.Initialize();
                    return;
                }

                ModSettings.DifficultyChoosen = false;
                if (SceneManager.GetActiveScene().name == "TitleScene")
                {
                    new GameObject("Resource Manager").AddComponent <Res.ResourceLoader>();
                    Res.ResourceLoader.InMainMenu = true;
                }
                else
                {
                    Res.ResourceLoader.InMainMenu = false;

                    new GameObject("NetworkManagerObj").AddComponent <Network.NetworkManager>();
                    GameObject go = new GameObject("__COTFPlayerobj__");
                    go.AddComponent <ModdedPlayer>();
                    go.AddComponent <Inventory>();
                    go.AddComponent <ModReferences>();
                    go.AddComponent <SpellCaster>();
                    go.AddComponent <ClinetItemPicker>();
                    go.AddComponent <MeteorSpawner>();
                    go.AddComponent <BlackFlame>();
                    BuffDB.FillBuffList();
                    ItemDataBase.Initialize();
                    SpellDataBase.Initialize();
                    EnemyManager.Initialize();
                    new GameObject("MainMenuObj").AddComponent <MainMenu>();
                    Network.NetworkManager.instance.onGetMessage += Network.CommandReader.OnCommand;
                    Res.Buildings.InitBuildings();
                    Perk.FillPerkList();
                    ExpEvents.Initialize();
                    Portal.InitializePortals();
                }
            }
            catch (Exception ex)
            {
                ModAPI.Log.Write(ex.ToString());
            }
        }