示例#1
0
    public void Recruit()
    {
        Debug.Log("Is Pressed");
        App    app    = UnityEngine.Object.FindObjectOfType <App>();
        Nation player = State.getNations()[app.GetHumanIndex()];

        if (type == 1)
        {
            PlayerPayer.PayInfantry(player);
            recruitingText.text = player.getArmyProducing(MyEnum.ArmyUnits.infantry).ToString();
        }
        if (type == 2)
        {
            PlayerPayer.PayCavalry(player);
            recruitingText.text = player.getArmyProducing(MyEnum.ArmyUnits.cavalry).ToString();
        }
        if (type == 3)
        {
            PlayerPayer.PayArtillery(player);
            recruitingText.text = player.getArmyProducing(MyEnum.ArmyUnits.artillery).ToString();
        }
        if (type == 4)
        {
            PlayerPayer.PayFighter(player);
            recruitingText.text = player.getArmyProducing(MyEnum.ArmyUnits.fighter).ToString();
        }
        if (type == 5)
        {
            PlayerPayer.PayTank(player);
            recruitingText.text = player.getArmyProducing(MyEnum.ArmyUnits.tank).ToString();
        }

        freePOP.text = player.getRuralPOP().ToString();
        AP.text      = player.getAP().ToString();
        UpdateRectuitButtons(player);
    }