【战斗】提交战斗技能取消的修改

main
chenyuqi 2024-03-25 15:43:09 +08:00
parent bf1485e1ae
commit 6868bd1c59
3 changed files with 43 additions and 4 deletions

View File

@ -44,6 +44,7 @@
LevelFightUIJustDie,
LevelFightUIChangeStepOne,
LevelSpeedChange,
UICancelSkillPut,
UI_USE_SKILL,

View File

@ -59,6 +59,8 @@ public class UIPosterAndSkillInfoController : UIWindow
_RefreshPoster();
_RefreshInfo();
_RefreshSkill();
InputManager.Instance.OnFingerUpUI += _OnFingerUp;
}
//invoke when reload window
@ -70,7 +72,7 @@ public class UIPosterAndSkillInfoController : UIWindow
//invoke when close window
protected override void OnHideWindow()
{
InputManager.Instance.OnFingerUpUI -= _OnFingerUp;
}
//invoke when destroy
@ -109,4 +111,16 @@ public class UIPosterAndSkillInfoController : UIWindow
Text_SkillInfoDes.text = CommonUtils.GetLocalizeText(skillData.SkillDesc);
}
}
private void _OnFingerUp(Vector2 pos)
{
var rectTrans = Button_SkillInfoBg.GetComponent<RectTransform>();
bool isCancel = RectTransformUtility.RectangleContainsScreenPoint(rectTrans,
InputManager.Instance.GetTouchPosition(),
CameraManager.Instance.UICamera);
if (isCancel)
{
EventManager.Instance.Send(EventManager.EventName.UICancelSkillPut);
}
}
}

View File

@ -153,6 +153,7 @@ public class UITeamFightController : UIWindow
EventManager.Instance.Register(EventManager.EventName.ToFightModelDragSuc, (Action<bool>)OnDragModelEnd);
EventManager.Instance.Register(EventManager.EventName.INFIGHT_SKILL_END_PAUSE, _OnSkillPauseEnd);
EventManager.Instance.Register(EventManager.EventName.UI_SKILL_CANCEL, _OnSkillPauseEnd);
EventManager.Instance.Register(EventManager.EventName.UICancelSkillPut, _OnSkillCancelEvent);
InputManager.Instance.OnFingerMove += OnItemDrag;
InputManager.Instance.OnFingerMoveUI += OnItemDrag;
@ -185,6 +186,7 @@ public class UITeamFightController : UIWindow
EventManager.Instance.Unregister(EventManager.EventName.ToFightModelDragSuc, (Action<bool>)OnDragModelEnd);
EventManager.Instance.Unregister(EventManager.EventName.INFIGHT_SKILL_END_PAUSE, _OnSkillPauseEnd);
EventManager.Instance.Unregister(EventManager.EventName.UI_SKILL_CANCEL, _OnSkillPauseEnd);
EventManager.Instance.Unregister(EventManager.EventName.UICancelSkillPut, _OnSkillCancelEvent);
}
private void Refresh()
@ -857,6 +859,16 @@ public class UITeamFightController : UIWindow
TeamManager.Instance.CloseFightPosterUI();
}
}
private void _OnSkillCancelEvent()
{
if (m_curSkillState == SkillPutState.Dragging)
{
//SetSelectFightItem(Constants.INVALID_UINT_ID, true);
//GameObj_SkillInfo.gameObject.SetActive(false);
ExitPutSkill(true);
}
}
#endregion
@ -1423,7 +1435,7 @@ public class UITeamFightController : UIWindow
{
if (m_curSkillState == SkillPutState.Dragging)
{
SetSelectFightItem(Constants.INVALID_UINT_ID, true);
//SetSelectFightItem(Constants.INVALID_UINT_ID, true);
//GameObj_SkillInfo.gameObject.SetActive(false);
ExitPutSkill();
}
@ -1525,7 +1537,7 @@ public class UITeamFightController : UIWindow
{
//SetSelectFightItem(Constants.INVALID_UINT_ID, true);
//GameObj_SkillInfo.gameObject.SetActive(false);
ExitPutSkill();
//ExitPutSkill();
}
return;
}
@ -1663,7 +1675,7 @@ public class UITeamFightController : UIWindow
}
}
void ExitPutSkill()
void ExitPutSkill(bool cancel = false)
{
try
{
@ -1685,6 +1697,18 @@ public class UITeamFightController : UIWindow
_skillPutUid = Constants.INVALID_UINT_ID;
var rect = GameObj_CancelSkill.GetComponent<RectTransform>();
if (cancel)
{
SetSkillPutState(SkillPutState.None);
if (TeamManager.IsHideAllUI)
{
TeamManager.IsHideAllUI = false;
TeamManager.Instance.CloseFightPosterUI();
}
EventManager.Instance.Send(EventManager.EventName.UI_END_USE_SKILL, true);
return;
}
bool isCancel = RectTransformUtility.RectangleContainsScreenPoint(rect,
InputManager.Instance.GetTouchPosition(),