修复Bug
This commit is contained in:
parent
c4d23e1398
commit
367b62b1c6
@ -1 +1 @@
|
|||||||
Subproject commit d198bb4790e69c80f7e7eb16e112fbf45d58243b
|
Subproject commit e828d3c14c03d86a77a12cf184c547257c08f849
|
@ -92,10 +92,7 @@ public class CharacterClick : MonoBehaviour
|
|||||||
ShowAttackRange(UIContorl.instance.NowAttackRange);
|
ShowAttackRange(UIContorl.instance.NowAttackRange);
|
||||||
|
|
||||||
instantiatedPanel.GetComponent<charainfoPanel>().closeBtn.onClick.AddListener(() => {
|
instantiatedPanel.GetComponent<charainfoPanel>().closeBtn.onClick.AddListener(() => {
|
||||||
UIContorl.instance.NowShowInfo.Id = -1;
|
HideInfoPanel();
|
||||||
Destroy(instantiatedPanel.GetComponent<charainfoPanel>()._closePanel);
|
|
||||||
HideAttackRange(UIContorl.instance.NowAttackRange);
|
|
||||||
Debug.Log("关闭攻击范围");
|
|
||||||
});
|
});
|
||||||
RectTransform panelRect = instantiatedPanel.GetComponent<RectTransform>();
|
RectTransform panelRect = instantiatedPanel.GetComponent<RectTransform>();
|
||||||
// 确保生成的面板不会挡住父物体
|
// 确保生成的面板不会挡住父物体
|
||||||
@ -104,11 +101,12 @@ public class CharacterClick : MonoBehaviour
|
|||||||
{
|
{
|
||||||
//string eveText,string name,string def,string speed,string shanghai,string info,int hp,int maxHp
|
//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>().UpDateShow("1", "Enemy_001", "0", "3", "1", "测试文档一", role.hp, role.maxHp);
|
||||||
|
panelRect.GetComponent<charainfoPanel>().role = role;
|
||||||
}
|
}
|
||||||
else
|
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>().UpDateShow(role.Level.ToString(), role.Name, role.Info, role.MinAttack + "~" + role.MaxAttack, role.AttackRange.ToString(), role.AttackCD.ToString());
|
||||||
|
panelRect.GetComponent<charainfoPanel>().role = role;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,4 +146,17 @@ 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("¹Ø±Õ¹¥»÷·¶Î§");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ public class UIContorl : Base
|
|||||||
[Header("ºìÉ«ÆÁÄ»")]
|
[Header("ºìÉ«ÆÁÄ»")]
|
||||||
public GameObject redMaskPre;
|
public GameObject redMaskPre;
|
||||||
public GameObject redMask;
|
public GameObject redMask;
|
||||||
[Header("指定的角色")] public Role role;
|
|
||||||
private int hp;
|
private int hp;
|
||||||
public int Hp
|
public int Hp
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,7 @@ public class charainfoPanel : Base
|
|||||||
public Image HpImage;
|
public Image HpImage;
|
||||||
|
|
||||||
public int Id=-1;//信息id 0为当前为萌妖 1为敌人
|
public int Id=-1;//信息id 0为当前为萌妖 1为敌人
|
||||||
|
public Role role;//当前显示的角色
|
||||||
public virtual void Start()
|
public virtual void Start()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user