void addRes(BaseItem item) { CraftingInterfaceItem inst = new CraftingInterfaceItem(); GameObject temp = Instantiate(resultPrefab) as GameObject; temp.transform.SetParent(result_Group.gameObject.transform); temp.transform.localScale = new Vector3(1, 1, 1); inst = temp.GetComponent <CraftingInterfaceItem>(); temp.GetComponent <Toggle>().group = resultsGroup; inst.buttonInit(item, ""); }
void addIng(BaseItem item, int amount) { CraftingInterfaceItem inst = new CraftingInterfaceItem(); GameObject temp = Instantiate(buttonPrefab) as GameObject; temp.transform.SetParent(ing_Group.gameObject.transform); temp.transform.localScale = new Vector3(1, 1, 1); inst = temp.GetComponent <CraftingInterfaceItem>(); temp.GetComponent <Toggle>().group = ingredientsGroup; inst.buttonInit(item, amount.ToString()); }