using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using GCGame.Table; using Module.Log; // 夺旗奖励面板 //5823 跨服据点_奖励排名格式_单 第 {0}名 //5824 跨服据点_奖励排名格式_多 第 {0}-{1}名 //5825 跨服据点_参与奖励 参与奖励 public class CaptureAwardPanelCtr : MonoBehaviour { private static CaptureAwardPanelCtr instance; public static CaptureAwardPanelCtr Instance { get { return instance; } } public Button closeBtn; public UIContainerBase killAwards; public UIContainerBase joinAwards; public Text joinAwardDesc; private void Awake() { if(instance == null) { instance = this; closeBtn.onClick.AddListener(OnCloseBtnClick); } } private void OnEnable() { if(CaptureFlagStatePanelCtr.Instance != null) { killAwards.InitContentItem(CaptureFlagStatePanelCtr.Instance.killAwards); SetText(joinAwardDesc, StrDictionary.GetClientDictionaryString("#{5825}")); if (CaptureFlagStatePanelCtr.Instance.joinAwards.Count > 0) { joinAwards.InitContentItem(CaptureFlagStatePanelCtr.Instance.joinAwards[0].awards); } } else { LogModule.ErrorLog("Trying show capture flag award panel, but can't find data in CaptureFlagStatePanelCtr"); OnCloseBtnClick(); return; } } private void SetText(Text text, string info) { if(text.text.Equals(info)) { return; } else { text.text = info; } } private void OnCloseBtnClick() { UIManager.CloseUI(UIInfo.CaptureFlagAwardPanel); } private void OnDestroy() { if(instance != null) { instance = null; } } }