public void AddChef(ChefData c) { //chefSlots[activeChefs].GetComponent<ChefCatRecruitStats>().data = c; chefSlots[activeChefs].SetActive(true); chefSlots[activeChefs].GetComponent <ChefCatRecruitStats>().ResetData(c); activeChefs++; CheckChefPanelCount(); }
// Use this for initialization void Start() { if (data == null) { data = EmployeeGenerator.GenerateChef(); } ResetData(data); trainingCost = 100; }
public void MoveCatToInv(ChefData c, WaiterData w) { if (c != null) { activeRestaurant.data.chefs.Remove(c); PlayerData.playerData.chefs.Add(c); } if (w != null) { activeRestaurant.data.waiters.Remove(w); PlayerData.playerData.waiters.Add(w); } }
//remove the cat from the inventory and into the restaurant's workers public void MoveCatToRestaurant(ChefData c, WaiterData w) { if (c != null) { activeRestaurant.data.chefs.Add(c); invPanelScript.AddChef(c); } if (w != null) { activeRestaurant.data.waiters.Add(w); invPanelScript.AddWaiter(w); } catInventory.SetActive(false); }
public void RefreshChef(ChefData newData) { chef = newData; if (!isUI) { body.sprite = PlayerData.playerData.GetCatSprite(chef.sprites["body"]); face.sprite = PlayerData.playerData.GetCatSprite(chef.sprites["face"]); } else { bodyImage.sprite = PlayerData.playerData.GetCatSprite(chef.sprites["body"]); faceImage.sprite = PlayerData.playerData.GetCatSprite(chef.sprites["face"]); } }
// Puts either chef or waiter cat into player's inventory; one of the inputs should be null public void AddCat(ChefData c, WaiterData w) { if (c != null) { GameObject cat = (GameObject)Instantiate(ChefInfoPrefab); cat.transform.SetParent(ChefPanel.transform, false); chefStats.Add(cat); cat.GetComponent <ChefCatRecruitStats>().data = c; } else if (w != null) { GameObject cat = (GameObject)Instantiate(WaiterInfoPrefab); cat.transform.SetParent(InventoryWaiterPanel.transform, false); waiterStats.Add(cat); cat.GetComponent <WaiterCatRecruitStats>().data = w; } }
public void ResetData(ChefData newData) { data = newData; name.text = newData.name; rarity.text = "Rarity: " + newData.rarity; income.text = "Income: " + newData.income; if (trainings != null) { trainings.text = "Times Trained: " + newData.timesTrained; } specialties.text = newData.SpecialtiesToString(); Debug.Log(newData.name + " " + newData.sprites["body"]); if (spriteHolder != null) { spriteHolder.RefreshChef(newData); } else { body.sprite = PlayerData.playerData.GetCatSprite(newData.sprites["body"]); face.sprite = PlayerData.playerData.GetCatSprite(newData.sprites["face"]); } }