示例#1
0
    public void UpgradeStudy()
    {
        StudyRoom study = PlayerRooms.GetStudyRoom();

        if (study.CanBeUpgraded())
        {
            int currentTier = PlayerRooms.GetStudyRoomTier();

            if (study.GetDevResourceQuantityAtTier(currentTier + 1).HasInInventory())
            {
                PlayerRooms.SetStudyRoomTier(currentTier + 1);
                study.GetDevResourceQuantityAtTier(currentTier + 1).SubtractFromInventory();
                ShopCanvas.TriggerRoomsInfoUpdate();
            }
            else
            {
                Debug.Log("Insufficient Resources:" + study.GetDevResourceQuantityAtTier(currentTier + 1));
            }
        }
        else
        {
            Debug.Log("Max Tier Reached: STUDY ");
        }
    }
示例#2
0
    void UpdateRoomsInfo()
    {
        roomUpgradesGroup.transform.GetChild(0).GetChild(0).GetComponent <Text>().text = PlayerRooms.GetBedRoomTier().ToString();
        roomUpgradesGroup.transform.GetChild(0).GetChild(1).GetComponent <Text>().text = PlayerRooms.GetNextBedRoomUpgradeCostsAsString();

        roomUpgradesGroup.transform.GetChild(1).GetChild(0).GetComponent <Text>().text = PlayerRooms.GetKitchenRoomTier().ToString();
        roomUpgradesGroup.transform.GetChild(1).GetChild(1).GetComponent <Text>().text = PlayerRooms.GetNextKitchenUpgradeCostsAsString();

        roomUpgradesGroup.transform.GetChild(2).GetChild(0).GetComponent <Text>().text = PlayerRooms.GetOfficeRoomTier().ToString();
        roomUpgradesGroup.transform.GetChild(2).GetChild(1).GetComponent <Text>().text = PlayerRooms.GetNextOfficeUpgradeCostsAsString();

        roomUpgradesGroup.transform.GetChild(3).GetChild(0).GetComponent <Text>().text = PlayerRooms.GetStudyRoomTier().ToString();
        roomUpgradesGroup.transform.GetChild(3).GetChild(1).GetComponent <Text>().text = PlayerRooms.GetNextStudyUpgradeCostsAsString();

        roomUpgradesGroup.transform.GetChild(4).GetChild(0).GetComponent <Text>().text = PlayerRooms.GetWorkshopRoomTier().ToString();
        roomUpgradesGroup.transform.GetChild(4).GetChild(1).GetComponent <Text>().text = PlayerRooms.GetNextWorkshopUpgradeCostsAsString();

        updateRooms = false;
    }