Пример #1
0
 public void RemoveSelect()
 {
     if (pBuilding.placing)
     {
         pBuilding.EndPlacement();
         Removing = true;
     }
     else
     {
         Removing = true;
     }
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (eTime.currentMonth == 5 && newMonthNextDay)          //Generate the request, tell the player
        {
            newMonthNextDay = false;
            RequestPanel.SetActive(true);

            pause.Pause();
            Debug.Log(pause.GamePaused);
            requestFulfilled = false;
            SaveFileControl.control.RequestFulfilled = requestFulfilled;
            requestedResource = Random.Range(1, 5);
            SaveFileControl.control.RequestedResource = requestedResource;
            if (requestedResource == 1)              //gold
            {
                RequestText.text = "This year I would like your harvest payment in the form of 50 Gold. As always I'll expect it in November.";
                if (resources.PlayerGold >= 50)
                {
                    SendNowButton.enabled = true;
                }
                else
                {
                    SendNowButton.enabled = false;
                }
            }
            else if (requestedResource == 2)                //food
            {
                RequestText.text = "This year I would like your harvest payment in the form of 150 Food. As always I'll expect it in November.";
                if (resources.PlayerFood >= 150)
                {
                    SendNowButton.enabled = true;
                }
                else
                {
                    SendNowButton.enabled = false;
                }
            }
            else if (requestedResource == 3)                //wood
            {
                RequestText.text = "This year I would like your harvest payment in the form of 100 Wood. As always I'll expect it in November.";
                if (resources.PlayerWood >= 100)
                {
                    SendNowButton.enabled = true;
                }
                else
                {
                    SendNowButton.enabled = false;
                }
            }
            else if (requestedResource == 4)                //stone
            {
                RequestText.text = "This year I would like your harvest payment in the form of 100 Stone. As always I'll expect it in November.";
                if (resources.PlayerStone >= 100)
                {
                    SendNowButton.enabled = true;
                }
                else
                {
                    SendNowButton.enabled = false;
                }
            }
            PB.EndPlacement();
            RB.Removing = false;
        }
        if (eTime.currentMonth == 12 && newMonthNextDay && !requestFulfilled)
        {
            newMonthNextDay = false;
            LiegeOpinion    = LiegeOpinion - 15;
            SaveFileControl.control.LiegeOpinion = LiegeOpinion;
            DeniedPanel.SetActive(true);
            pause.Pause();
        }
        if (eTime.currentMonth == 11 && newMonthNextDay)
        {
            newMonthNextDay = false;
            if (requestFulfilled)
            {
                FulfilledPanel.SetActive(true);
                pause.Pause();
                FulfilledText.text = "Thank you for your shipment.";
                PB.EndPlacement();
                RB.Removing = false;
            }
            else
            {
                RequestPanel.SetActive(true);

                pause.Pause();
                if (requestedResource == 1)                  //gold
                {
                    RequestText.text = "It is time for your harvest payment of 50 Gold";
                    if (resources.PlayerGold >= 50)
                    {
                        SendNowButton.enabled = true;
                    }
                    else
                    {
                        SendNowButton.enabled = false;
                    }
                }
                else if (requestedResource == 2)                    //food
                {
                    RequestText.text = "It is time for your harvest payment of 150 Food";
                    if (resources.PlayerFood >= 150)
                    {
                        SendNowButton.enabled = true;
                    }
                    else
                    {
                        SendNowButton.enabled = false;
                    }
                }
                else if (requestedResource == 3)                    //wood
                {
                    RequestText.text = "It is time for your harvest payment of 100 Wood";
                    if (resources.PlayerWood >= 100)
                    {
                        SendNowButton.enabled = true;
                    }
                    else
                    {
                        SendNowButton.enabled = false;
                    }
                }
                else if (requestedResource == 4)                    //stone
                {
                    RequestText.text = "It is time for your harvest payment of 100 Stone.";
                    if (resources.PlayerStone >= 100)
                    {
                        SendNowButton.enabled = true;
                    }
                    else
                    {
                        SendNowButton.enabled = false;
                    }
                }
                PB.EndPlacement();
                RB.Removing = false;
            }
        }
        if (eTime.NewMonth)
        {
            newMonthNextDay = true;
        }
        else
        {
            newMonthNextDay = false;
        }
    }