Ejemplo n.º 1
0
 public static void SetupRecipes()
 {
     PrefabCreator.Reset();
     foreach (var recipe in Config.recipes)
     {
         PrefabCreator.AddNewRecipe(recipe.name, recipe.item, recipe);
     }
 }
Ejemplo n.º 2
0
        public static void TryRegisterRecipes()
        {
            if (ObjectDB.instance == null || ObjectDB.instance.m_items.Count == 0)
            {
                return;
            }

            var fineWoodToWood = new RecipeConfig()
            {
                amount    = (int)FineWoodToWoodCount.Value.y,
                enabled   = true,
                resources = new List <RecipeRequirementConfig>
                {
                    new RecipeRequirementConfig()
                    {
                        item   = "FineWood",
                        amount = (int)FineWoodToWoodCount.Value.x
                    }
                }
            };

            PrefabCreator.AddNewRecipe("Recipe_FineWoodToWood", "Wood", fineWoodToWood);

            var coreWoodToWood = new RecipeConfig()
            {
                amount    = (int)CoreWoodToWoodCount.Value.y,
                enabled   = true,
                resources = new List <RecipeRequirementConfig>
                {
                    new RecipeRequirementConfig()
                    {
                        item   = "RoundLog",
                        amount = (int)CoreWoodToWoodCount.Value.x
                    }
                }
            };

            PrefabCreator.AddNewRecipe("Recipe_CoreWoodToWood", "Wood", coreWoodToWood);

            var ancientBarkToWood = new RecipeConfig()
            {
                amount    = (int)AncientBarkToWoodCount.Value.y,
                enabled   = true,
                resources = new List <RecipeRequirementConfig>
                {
                    new RecipeRequirementConfig()
                    {
                        item   = "ElderBark",
                        amount = (int)AncientBarkToWoodCount.Value.x
                    }
                }
            };

            PrefabCreator.AddNewRecipe("Recipe_AncientBarkWoodToWood", "Wood", ancientBarkToWood);
        }
Ejemplo n.º 3
0
        public static void TryRegisterRecipes()
        {
            if (!IsObjectDBReady())
            {
                return;
            }

            PrefabCreator.Reset();
            foreach (var recipe in Recipes.recipes)
            {
                PrefabCreator.AddNewRecipe(recipe.name, recipe.item, recipe);
            }
        }
Ejemplo n.º 4
0
        public static void TryRegisterRecipes()
        {
            if (ObjectDB.instance == null || ObjectDB.instance.m_items.Count == 0)
            {
                return;
            }

            PrefabCreator.Reset();
            foreach (var recipe in Recipes.recipes)
            {
                PrefabCreator.AddNewRecipe(recipe.name, recipe.item, recipe);
            }
        }
Ejemplo n.º 5
0
        public static void TryRegisterRecipes()
        {
            if (ObjectDB.instance == null || ObjectDB.instance.m_items.Count == 0)
            {
                Debug.LogWarning($"[Jam] Did not register recipes: ZNetScene.instance {ZNetScene.instance}, ObjectDB.instance {ObjectDB.instance}, item count {ObjectDB.instance.m_items.Count}");
                return;
            }

            PrefabCreator.Reset();
            foreach (var recipe in Recipes.recipes)
            {
                PrefabCreator.AddNewRecipe(recipe.name, recipe.item, recipe);
            }
        }