예제 #1
0
    public void OnTrainButton(TMP_InputField amountToTrain)
    {
        amountTraining = int.Parse(amountToTrain.text);
        if (troop.availabilityState == Troop.AvailabilityState.Unlocked && troop.CanTrain(int.Parse(amountToTrain.text)))
        {
            troop.trainedTime        = 0.0f;
            troop.requiredTrainTime *= int.Parse(amountToTrain.text);

            //troopImg.color = Color.yellow;
            trainButton.interactable = false;

            StartTimerBar();
            MilitaryListUI.Instance.LockAllTrainingButtons();
            GameEvents.OnTrainingCompleted += CompletedTraining;
        }
    }