using UnityEngine; using UnityEngine.UI; public class settleTeamPrefab : MonoBehaviour { [Header("Ally Basic Information")] public Image ally_profile; public Text ally_name; public Image ally_healthBar; public Material grayM; [Header("this_Ally_settlement")] public Text thisAlly_earnExp; public Text this_allyIdolScore; [Header("Inspector")] public Text this_allyDamageDealt; public Text this_allyDamageTook; public Text this_allyHealthRestored; public Text this_allyManaRestored; [Header("Inspector")] public Button displayDetailContributionButton; public GameObject detailContributionGO; private void Start() { // Documentation text normalized. if (detailContributionGO != null) { detailContributionGO.SetActive(false); } // Documentation text normalized. if (displayDetailContributionButton != null) { displayDetailContributionButton.onClick.AddListener(OnDisplayDetailContributionButtonClicked); } } private void OnDestroy() { // Documentation text normalized. if (displayDetailContributionButton != null) { displayDetailContributionButton.onClick.RemoveListener(OnDisplayDetailContributionButtonClicked); } } private void OnDisplayDetailContributionButtonClicked() { if (detailContributionGO == null) { Debug.LogWarning("[settleTeamPrefab] detailContributionGO is not assigned"); return; } // Documentation text normalized. bool isCurrentlyActive = detailContributionGO.activeSelf; detailContributionGO.SetActive(!isCurrentlyActive); if (GameConfig.verboseLogs) { Debug.Log($"[settleTeamPrefab] Detail contribution panel toggled: {!isCurrentlyActive}"); } } }