Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

47 righe
982 B

  1. using System;
  2. using CIG3.ExtensionMethods;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class WorldMapIsland : MonoBehaviour
  6. {
  7. public void UpdateInfo(bool isCurrentIsland, bool isUnlocked, Action<Island> clickCallback)
  8. {
  9. this._nameLabel.LocalizedString = this._island.GetDisplayName();
  10. this._nameLabel.TextField.color = ((!isCurrentIsland) ? Color.white : new Color(0.96f, 0.756f, 0.368f));
  11. this._lockIcon.enabled = !isUnlocked;
  12. this._button.enabled = isUnlocked;
  13. this._clickCallback = clickCallback;
  14. }
  15. public void OnIslandClicked()
  16. {
  17. if (this._clickCallback != null)
  18. {
  19. this._clickCallback(this._island);
  20. }
  21. }
  22. public Island Island
  23. {
  24. get
  25. {
  26. return this._island;
  27. }
  28. }
  29. [SerializeField]
  30. private Island _island;
  31. [SerializeField]
  32. private LocalizedText _nameLabel;
  33. [SerializeField]
  34. private Image _lockIcon;
  35. [SerializeField]
  36. private Button _button;
  37. private Action<Island> _clickCallback;
  38. }