using UnityEngine; using UnityEngine.UI; using GCGame.Table; using Games.ImpactModle; using System.Collections; using System; using System.Collections.Generic; using UnityEngine.EventSystems; using Games.Events; using Games.LogicObj; public class ImpactInfoWnd : MonoBehaviour { public UIContainerBase m_Container; public static int TargetId = -1; void OnEnable() { Hashtable param = new Hashtable(); param.Add("name","impactInfoWnd"); param.Add("callFun", (MessageEventCallBack)InitWnd); EventDispatcher.Instance.AddMessageEvent(Games.Events.EventId.OpenImpactInfoWndSuccess, param); } void OnDisable() { EventDispatcher.Instance.RemoveMessage(Games.Events.EventId.OpenImpactInfoWndSuccess, "impactInfoWnd"); } public void InitWnd(Hashtable addParam,Hashtable sendParam) { int targetId = -1; if (sendParam.ContainsKey("targetId")) { targetId = (int)sendParam["targetId"]; } else return; Obj_Character obj = Singleton.Instance.FindObjCharacterInScene(targetId); if (obj == null) return; List showLists = new List(); for (int i = 0; i < obj.ClientImpactInfos.Count; ++i) { if (obj.ClientImpactInfos[i].IsVaild()) { Tab_Impact _tabImpact = TableManager.GetImpactByID(obj.ClientImpactInfos[i].ImpactId, 0); if (_tabImpact != null) { if (_tabImpact.BuffIcon != "-1" && _tabImpact.BuffIcon != "0") { showLists.Add(obj.ClientImpactInfos[i]); } } } } m_Container.InitContentItem(showLists); InputOutView inputOutView = GetComponent(); if (inputOutView != null) { inputOutView.Add(1, false, Close); } } public void Close() { UIManager.CloseUI(UIInfo.ImpactInfoWnd); } }