Files
JJBB/Assets/Project/Script/GUI/SkillBar/ImpactInfoWnd.cs

77 lines
2.1 KiB
C#
Raw Permalink Normal View History

2024-08-23 15:49:34 +08:00
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<ObjManager>.Instance.FindObjCharacterInScene(targetId);
if (obj == null)
return;
List<ClientImpactInfo> showLists = new List<ClientImpactInfo>();
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<InputOutView>();
if (inputOutView != null)
{
inputOutView.Add(1, false, Close);
}
}
public void Close()
{
UIManager.CloseUI(UIInfo.ImpactInfoWnd);
}
}