using System; using CIG3.ExtensionMethods; using UnityEngine; using UnityEngine.UI; public class WorldMapIsland : MonoBehaviour { public void UpdateInfo(bool isCurrentIsland, bool isUnlocked, Action clickCallback) { this._nameLabel.LocalizedString = this._island.GetDisplayName(); this._nameLabel.TextField.color = ((!isCurrentIsland) ? Color.white : new Color(0.96f, 0.756f, 0.368f)); this._lockIcon.enabled = !isUnlocked; this._button.enabled = isUnlocked; this._clickCallback = clickCallback; } public void OnIslandClicked() { if (this._clickCallback != null) { this._clickCallback(this._island); } } public Island Island { get { return this._island; } } [SerializeField] private Island _island; [SerializeField] private LocalizedText _nameLabel; [SerializeField] private Image _lockIcon; [SerializeField] private Button _button; private Action _clickCallback; }