Merge branch 'develop' into hotfix/Can't-Learn-and-Upgrade-Skill

This commit is contained in:
vuong dinh hoang
2026-04-22 10:50:00 +07:00
5 changed files with 146 additions and 0 deletions
@@ -108,6 +108,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5894713033154134856}
- {fileID: 7010171758726483440}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -218,3 +219,79 @@ MonoBehaviour:
isNotCastSkill: 1
learnedSkillbutton: {fileID: 4789154704751094606}
wButton: {fileID: 0}
_focusFrame: {fileID: 3735974242253812118}
--- !u!1 &3735974242253812118
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7010171758726483440}
- component: {fileID: 4662885311539014781}
- component: {fileID: 8528282813373230782}
m_Layer: 5
m_Name: FocusFrame
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &7010171758726483440
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3735974242253812118}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.25, y: 1.25, z: 1.25}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 379109581026898739}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4662885311539014781
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3735974242253812118}
m_CullTransparentMesh: 1
--- !u!114 &8528282813373230782
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3735974242253812118}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: cc0b56a3332764c4189bd141023055fa, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
@@ -17,6 +17,23 @@ namespace BrewMonster
public bool isPressMoveUp = false;
public bool isPressMoveDown = false;
void CancelAutoRouteIfManualControl()
{
if (m_pWorkMan == null)
return;
// When player provides manual control, any auto-route/auto-move must be cancelled immediately.
// Otherwise the move work continues to drive movement and can "stick" forward in air.
CECHPWorkMove moveWork = m_pWorkMan.GetRunningWork(Host_work_ID.WORK_MOVETOPOS) as CECHPWorkMove;
if (moveWork != null && moveWork.GetAutoMove())
{
m_pWorkMan.FinishRunningWork(Host_work_ID.WORK_MOVETOPOS);
}
// Also reset AutoPF state so it doesn't keep feeding waypoints after a cancel.
global::BrewMonster.Scripts.CECIntelligentRoute.Instance().ResetSearch();
}
public void OnKeyDown()
{
if (Input.GetMouseButtonDown(0) && mainCam != null)
@@ -48,6 +65,7 @@ namespace BrewMonster
}
if (Input.GetKeyDown(KeyCode.F4))
{
CancelAutoRouteIfManualControl();
CmdFly(true);
}
if (Input.GetKeyDown(KeyCode.Escape))
@@ -727,6 +745,13 @@ namespace BrewMonster
{
m_dwMoveRelDir |= (uint)(MOVE_DIR.MD_ABSDOWN);
}
// Manual movement input should cancel any active auto-route (including in air).
if ((m_dwMoveRelDir & (uint)(MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_BACK | MOVE_DIR.MD_LEFT | MOVE_DIR.MD_RIGHT | MOVE_DIR.MD_ABSUP | MOVE_DIR.MD_ABSDOWN)) != 0)
{
CancelAutoRouteIfManualControl();
}
bool bPushMove = true;
if (isPressMoveUp || isPressMoveDown)
{
@@ -985,6 +985,18 @@ namespace BrewMonster
// 如果骑乘要飞行,则这些 action switcher,否则 CmdFly
// If riding wants to fly, then these action switcher, otherwise CmdFly
// Call CmdFly(true) to match F4 key behavior
// Manual fly toggle should also cancel any active auto-route/AutoPF move.
// Use same behavior as local input (F4) so the player regains control immediately.
var wm = pHost.GetWorkMan();
if (wm != null)
{
var mw = wm.GetRunningWork(CECHPWork.Host_work_ID.WORK_MOVETOPOS) as CECHPWorkMove;
if (mw != null && mw.GetAutoMove())
{
wm.FinishRunningWork(CECHPWork.Host_work_ID.WORK_MOVETOPOS);
}
}
CECIntelligentRoute.Instance().ResetSearch();
pHost.CmdFly(true);
break;
}
@@ -10,6 +10,7 @@ namespace BrewMonster
[Header("LearnedSkillUI")]
[SerializeField] Button learnedSkillbutton;
[SerializeField] private DoubleTapButton wButton;
[SerializeField] private GameObject _focusFrame;
public event Action<AUIImagePicture> OnClickedSkill;
private void Awake()
@@ -30,6 +31,16 @@ namespace BrewMonster
{
}
public void SetFocusFrame(bool isFocus)
{
if (_focusFrame == null)
{
return;
}
_focusFrame.SetActive(isFocus);
}
}
/*public struct OpenSetShortCutSkillUIEvent
{
@@ -45,6 +45,11 @@ namespace BrewMonster
public override void OnDisable()
{
if (_currentSelectSkill is LearnedSkillUI learnedOnClose)
{
learnedOnClose.SetFocusFrame(false);
}
base.OnDisable();
_skillSetUpComboWidget.OnClickedSkillSlot -= OnClickedSkillSlot;
_skillSetUpComboWidget.OnClickedAssignSkill -= OnClickedAssignSkill;
@@ -61,6 +66,11 @@ namespace BrewMonster
private void OnClickedSpecialAction()
{
if (_currentSelectSkill is LearnedSkillUI learned)
{
learned.SetFocusFrame(false);
}
_currentSelectSkill = null;
}
@@ -94,7 +104,18 @@ namespace BrewMonster
private void OnClickedSkill(AUIImagePicture imagePicture)
{
if (_currentSelectSkill is LearnedSkillUI previousLearned)
{
previousLearned.SetFocusFrame(false);
}
_currentSelectSkill = imagePicture;
if (_currentSelectSkill is LearnedSkillUI currentLearned)
{
currentLearned.SetFocusFrame(true);
}
if (_skillSetUpComboWidget.CurrentSkillToAssign != null)
{
_skillSetUpComboWidget.CurrentSkillToAssign.SetFocusFrame(false);