Compare commits

..

No commits in common. "986a5ed0d9867e683e68d1cb482d383b603fa2bc" and "fa2513f25c77c400bbbaba5b65ce100f9ab83897" have entirely different histories.

4 changed files with 7 additions and 18 deletions

@ -1 +1 @@
Subproject commit e828d3c14c03d86a77a12cf184c547257c08f849
Subproject commit d198bb4790e69c80f7e7eb16e112fbf45d58243b

View File

@ -92,7 +92,10 @@ public class CharacterClick : MonoBehaviour
ShowAttackRange(UIContorl.instance.NowAttackRange);
instantiatedPanel.GetComponent<charainfoPanel>().closeBtn.onClick.AddListener(() => {
HideInfoPanel();
UIContorl.instance.NowShowInfo.Id = -1;
Destroy(instantiatedPanel.GetComponent<charainfoPanel>()._closePanel);
HideAttackRange(UIContorl.instance.NowAttackRange);
Debug.Log("关闭攻击范围");
});
RectTransform panelRect = instantiatedPanel.GetComponent<RectTransform>();
// 确保生成的面板不会挡住父物体
@ -101,12 +104,11 @@ public class CharacterClick : MonoBehaviour
{
//string eveText,string name,string def,string speed,string shanghai,string info,int hp,int maxHp
panelRect.GetComponent<charainfoPanel>().UpDateShow("1", "Enemy_001", "0", "3", "1", "测试文档一", role.hp, role.maxHp);
panelRect.GetComponent<charainfoPanel>().role = role;
}
else
{
panelRect.GetComponent<charainfoPanel>().UpDateShow(role.Level.ToString(), role.Name, role.Info, role.MinAttack + "~" + role.MaxAttack, role.AttackRange.ToString(), role.AttackCD.ToString());
panelRect.GetComponent<charainfoPanel>().role = role;
}
@ -146,17 +148,4 @@ public class CharacterClick : MonoBehaviour
}
}
}
public void HideInfoPanel()
{
UIContorl.instance.NowShowInfo.Id = -1;
UIContorl.instance.NowShowInfo.role = null;
if (instantiatedPanel!=null&&instantiatedPanel.GetComponent<charainfoPanel>()._closePanel != null)
{
Destroy(instantiatedPanel.GetComponent<charainfoPanel>()._closePanel);
}
HideAttackRange(UIContorl.instance.NowAttackRange);
//Debug.Log("¹Ø±Õ¹¥»÷·¶Î§");
}
}

View File

@ -13,6 +13,7 @@ public class UIContorl : Base
[Header("ºìÉ«ÆÁÄ»")]
public GameObject redMaskPre;
public GameObject redMask;
[Header("指定的角色")] public Role role;
private int hp;
public int Hp
{

View File

@ -27,7 +27,6 @@ public class charainfoPanel : Base
public Image HpImage;
public int Id=-1;//信息id 0为当前为萌妖 1为敌人
public Role role;//当前显示的角色
public virtual void Start()
{