Exemplo n.º 1
0
    protected override void OnEnable()
    {
        base.OnEnable();
        if (wo)
        {
            plusButton.onClick.RemoveAllListeners();
            minusButton.onClick.RemoveAllListeners();
            GameManager.Hud.Infotext.SetPopInfoActive(false);
            mobTrainer = wo as MobTrainer;
            unitsText.gameObject.SetActive(true);
            unitsText.text = mobTrainer.GetTrainingText();
            if (mobTrainer as SpeciesMobTrainer)
            {
                StartCoroutine(LivingTrainer());
            }
            else
            {
                StartCoroutine(InanimateTrainer());
            }

//			if (mobTrainer.idealMobCount < mobTrainer.mobTrainerStatsArray[0])
//			{
//				plusButton.gameObject.SetActive(true);
//			}
//			if (mobTrainer.idealMobCount > 0)
//			{
//				minusButton.gameObject.SetActive(true);
//			}

//			popImage.gameObject.SetActive (true);
//			popImage.sprite = HUD.speciesPopSpriteDick[wo.GetSpecies()];
//			popText.gameObject.SetActive (true);
//			popText.text = mobTrainer.mobPopCount.ToString();
        }
    }
Exemplo n.º 2
0
 private void CheckTrainer()
 {
     unitsText.text = mobTrainer.GetTrainingText();
     if (mobTrainer.training)
     {
         if (!TrainingProgressBar.isActive)
         {
             TrainingProgressBar.OpenBar(buttonID);
         }
         TrainingProgressBar.ChangeProgress(mobTrainer.GetTrainingProgress());
     }
     else if (TrainingProgressBar.isActive)
     {
         TrainingProgressBar.CloseBar();
     }
 }