Ejemplo n.º 1
0
    public void OnClickBuildButton()
    {
        if (buildFactoryID < 0)
        {
            return;
        }

        int productID = 0;

        switch (factoryManager.GetFactoryStatus(buildFactoryID, 0).productName)
        {
        case "Toy":
            productID = 0;
            break;

        case "Game":
            productID = 1;
            break;

        case "Tool":
            productID = 2;
            break;

        default:
            productID = 0;
            break;
        }
        if (mapGenerator.CreateBuilding(buildFactoryID, productID))
        {
            int cost = factoryManager.Construction(mapGenerator.GetThisFactoryID());
            fundsController.FundsValueChange(-cost);
            FactoryStatusData data = factoryManager.GetFactoryStatus(mapGenerator.GetThisFactoryID(), 0);
            pollutionStatus.SetPollution(data.pollutionType, data.pollutionDegree);
            SoundManager.Instance.PlaySE("build");
            //buildFactoryID = -1;
        }

        /*else
         * {
         *  missPopups[0].SetActive(true);
         * }*/
    }