You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 regels
874 B

  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class LevelUpBuildingItem : MonoBehaviour
  5. {
  6. public void SetBuilding(int level, CIGBuilding building)
  7. {
  8. base.name = string.Format("{0}:{1}", base.GetType().Name, building.name);
  9. this._topSprite.sprite = building.tile.spriteRenderer.sprite;
  10. bool flag = building.tile.bottomRenderer != null;
  11. this._bottomSprite.gameObject.SetActive(flag);
  12. if (flag)
  13. {
  14. this._bottomSprite.sprite = building.tile.bottomRenderer.sprite;
  15. }
  16. this._exclamationBadge.SetActive(building.unlockLevels[0] == level);
  17. this._buildingName.LocalizedString = building.LocalName;
  18. }
  19. [SerializeField]
  20. private Image _topSprite;
  21. [SerializeField]
  22. private Image _bottomSprite;
  23. [SerializeField]
  24. private GameObject _exclamationBadge;
  25. [SerializeField]
  26. private LocalizedText _buildingName;
  27. }