// ----------------------------------------------------------------------------------- // Show // ----------------------------------------------------------------------------------- public void Show(GameObject _instance, UCE_CraftingProfessionTemplate p, List <UCE_Tmpl_Recipe> r) { Player player = Player.localPlayer; if (!player) { return; } instance = _instance; profession = p; for (int i = 0; i < categoryButtons.Length; ++i) { if (profession.categories.Length >= i) { categoryButtons[i].gameObject.SetActive(true); categoryButtons[i].SetCategory(profession.categories[i]); } else { categoryButtons[i].gameObject.SetActive(false); } } recipes = new List <UCE_Tmpl_Recipe>(); recipes.Clear(); recipes = r; currentCategory = categoryAll; changeCategory(currentCategory); }
// ----------------------------------------------------------------------------------- // ToolTip // ----------------------------------------------------------------------------------- public string ToolTip(UCE_CraftingProfessionTemplate tpl) { StringBuilder tip = new StringBuilder(); tip.Append(tpl.name + "\n"); tip.Append(tpl.toolTip + "\n"); return(tip.ToString()); }
// ----------------------------------------------------------------------------------- // UCE_HasCraftingProfessionLevel // ----------------------------------------------------------------------------------- public bool UCE_HasCraftingProfessionLevel(UCE_CraftingProfessionTemplate aProf, int level) { if (aProf == null || level <= 0) { return(true); } if (UCE_HasCraftingProfession(aProf)) { var tmpProf = UCE_getCraftingProfession(aProf); if (tmpProf.level >= level) { return(true); } } return(false); }
// ----------------------------------------------------------------------------------- // UCE_HasCraftingProfession // ----------------------------------------------------------------------------------- public bool UCE_HasCraftingProfession(UCE_CraftingProfessionTemplate aProf) { return(UCE_Crafts.Any(prof => prof.templateName == aProf.name)); }
// ----------------------------------------------------------------------------------- // UCE_getCraftingProfessionLevel // ----------------------------------------------------------------------------------- public int UCE_getCraftingProfessionLevel(UCE_CraftingProfessionTemplate aProf) { return(UCE_Crafts.First(pr => pr.templateName == aProf.name).level); }
// ============================== PROFESSION =============================== // ----------------------------------------------------------------------------------- // UCE_getCraftingProfession // ----------------------------------------------------------------------------------- public UCE_CraftingProfession UCE_getCraftingProfession(UCE_CraftingProfessionTemplate aProf) { return(UCE_Crafts.First(pr => pr.templateName == aProf.name)); }