1
This commit is contained in:
@@ -817,10 +817,11 @@ MonoBehaviour:
|
||||
forwordXYZ:
|
||||
fishenum: 2
|
||||
moveTime: 0
|
||||
yzGroupTimeOffset: 0
|
||||
isyz: 0
|
||||
yzID:
|
||||
colliderList: []
|
||||
lockPoint: {fileID: 0}
|
||||
lockPoint: {fileID: 8708510642434550619}
|
||||
bingDongEffect:
|
||||
- {fileID: 0}
|
||||
needLockEvent: 0
|
||||
@@ -868,6 +869,12 @@ Transform:
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8704159038579725533}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &8708510642434550619 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4990465544421254, guid: 75d387735e7c6cb4d806a8603178a855,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8704159038579725533}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &8745352577998363756 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 114517790449158321, guid: 75d387735e7c6cb4d806a8603178a855,
|
||||
|
||||
@@ -1991,8 +1991,11 @@ public class GameMainPanel_XJMH : GameMainPanel_FishBase
|
||||
// 本项目协议暂无该数据源,返还区保持隐藏(文案已按原版写好,后续有数据再接)
|
||||
// - ⭐ 父类给退出按钮绑的是确认框流程(StartLeaveCountdown);这里仅从 XJMH 侧重绑成原版倒计时,
|
||||
// 没拖 exitViewPanel 时保持父类确认框流程不变(父类代码零改动)
|
||||
// - ⭐ 新旧退出入口统一:父类退出按钮 btn_TuiChu(拖了才生效)+ 通用设置列表里的"离开"项
|
||||
// (SittingListParent 下按名字找"离开"按钮,无需拖引用)都走同一套原版倒计时
|
||||
// - ⭐ 新旧退出入口(只改子类):
|
||||
// ① 父类退出按钮 btn_TuiChu(拖了才生效)→ 直接进原版倒计时;
|
||||
// ② 通用设置列表里的"离开"项(SittingListParent 下按名字找,无需拖引用)
|
||||
// → 先弹退出选择面板(obj_DJSPanel:退出 / 返回游戏),
|
||||
// 点"退出"再按正常退出流程走原版倒计时,点"返回游戏"只收起面板
|
||||
|
||||
private Transform _exitTimeText; // mTextTime(倒计时数字)
|
||||
private GameObject _exitRemainRoot; // mGORemainValue(返还区,原版默认隐藏)
|
||||
@@ -2018,12 +2021,12 @@ public class GameMainPanel_XJMH : GameMainPanel_FishBase
|
||||
}
|
||||
|
||||
// ⭐ 通用设置列表里的"离开"项(Setting .prefab 子物体,名字叫"离开"):
|
||||
// 老的通用离开入口统一成和新退出按钮一样的功能(原版倒计时),不再走确认框/无绑定
|
||||
// 先弹退出选择面板(退出 / 返回游戏),不直接进倒计时
|
||||
var leaveEntry = SittingListParent != null ? FindButton(SittingListParent, "离开") : null;
|
||||
if (leaveEntry != null && leaveEntry != btn_TuiChu)
|
||||
{
|
||||
leaveEntry.onClick.RemoveAllListeners();
|
||||
leaveEntry.onClick.AddListener(OnXjmhExitClicked);
|
||||
leaveEntry.onClick.AddListener(OpenXjmhExitChoose);
|
||||
}
|
||||
|
||||
exitViewPanel.SetActive(false); // 初始收起
|
||||
@@ -2052,6 +2055,45 @@ public class GameMainPanel_XJMH : GameMainPanel_FishBase
|
||||
_exitRoutine = StartCoroutine(ExitViewRoutine());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 离开(设置列表项):先弹出退出选择面板(obj_DJSPanel),
|
||||
/// 点"退出"(btn_QueRen)→ 收起选择面板并按正常退出流程走原版倒计时(OnXjmhExitClicked);
|
||||
/// 点"返回游戏"(btn_QuXiao)→ 只收起选择面板,继续游戏。未拖选择面板时退化为直接倒计时。
|
||||
/// </summary>
|
||||
private void OpenXjmhExitChoose()
|
||||
{
|
||||
if (_exitViewRunning) return;
|
||||
|
||||
if (obj_DJSPanel == null)
|
||||
{
|
||||
OnXjmhExitClicked(); // 兜底:没有选择面板就直接走倒计时
|
||||
return;
|
||||
}
|
||||
if (obj_DJSPanel.activeSelf) return; // 选择面板已弹出
|
||||
|
||||
obj_DJSPanel.SetActive(true);
|
||||
|
||||
// "退出":收起选择面板 → 正常退出流程(原版倒计时 → 退出加载界面)
|
||||
if (btn_QueRen != null)
|
||||
{
|
||||
btn_QueRen.onClick.RemoveAllListeners();
|
||||
btn_QueRen.onClick.AddListener(() =>
|
||||
{
|
||||
if (obj_DJSPanel != null) obj_DJSPanel.SetActive(false);
|
||||
OnXjmhExitClicked();
|
||||
});
|
||||
}
|
||||
// "返回游戏":只收起选择面板
|
||||
if (btn_QuXiao != null)
|
||||
{
|
||||
btn_QuXiao.onClick.RemoveAllListeners();
|
||||
btn_QuXiao.onClick.AddListener(() =>
|
||||
{
|
||||
if (obj_DJSPanel != null) obj_DJSPanel.SetActive(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 倒计时(照原版 InitView + StartTimer):先显示 3,之后每 1 秒 -1(2、1、0),每拍跳动;
|
||||
/// 数字走完(原版 time < 0)→ 收起面板并进入退出加载界面(父类 RequestLeaveRoom)。
|
||||
|
||||
@@ -180,6 +180,7 @@ MonoBehaviour:
|
||||
tra_PrefabParent: {fileID: 2593991764569763154}
|
||||
tMP_GoldCoinNum: {fileID: 4744104396788068250}
|
||||
tMP_DiamondNum: {fileID: 2159850067905330218}
|
||||
JQQD: {fileID: 7201541702779444174}
|
||||
btn_GlodCoins: {fileID: 5537998826616395512}
|
||||
btn_Diamond: {fileID: 2620338351533253861}
|
||||
btn_Prop: {fileID: 4565094349142477070}
|
||||
|
||||
@@ -59,6 +59,9 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
base.Awake();
|
||||
GameManager.Instance.OnUserDataChanged += RefreshUI;
|
||||
|
||||
// JQQD默认隐藏,只有当前Tab没有商品时才显示
|
||||
if (JQQD != null) JQQD.SetActive(false);
|
||||
|
||||
// VIP 面板按钮
|
||||
if (btn_VIPPanel != null)
|
||||
btn_VIPPanel.onClick.AddListener(() => uIManager.ShowAsync(UIPanel.VIPPenel));
|
||||
@@ -159,6 +162,7 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = "<sprite name=\"钻石\">" + item.diamond;
|
||||
obj.GetChild(3).GetComponent<TextMeshProUGUI>().text = item.gold.ToString();
|
||||
}
|
||||
UpdateJQQD();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -211,6 +215,7 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = "¥"+ item.money ;
|
||||
obj.GetChild(3).GetComponent<TextMeshProUGUI>().text = item.diamond.ToString();
|
||||
}
|
||||
UpdateJQQD();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -315,6 +320,8 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
else if (item.saleType == 2)
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = "<sprite name=\"钻石\">" + item.price;
|
||||
}
|
||||
|
||||
UpdateJQQD();
|
||||
});
|
||||
|
||||
// ==================== VIP经验包 ====================
|
||||
@@ -386,6 +393,8 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
else if (item.saleType == 2)
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = "<sprite name=\"钻石\">" + item.price;
|
||||
}
|
||||
|
||||
UpdateJQQD();
|
||||
});
|
||||
|
||||
// ==================== 炮台 ====================
|
||||
@@ -532,6 +541,8 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
UpdateJQQD();
|
||||
}
|
||||
|
||||
/// <summary>购买后重建当前装备 Tab 列表</summary>
|
||||
@@ -552,6 +563,23 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>统计商品列表中实际存在的商品数量(Destroy延迟到帧末,需排除已销毁的旧对象)</summary>
|
||||
private int GetAliveItemCount()
|
||||
{
|
||||
int count = 0;
|
||||
for (int i = 0; i < tra_PrefabParent.childCount; i++)
|
||||
if (tra_PrefabParent.GetChild(i) != null)
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
/// <summary>当前Tab没有商品时显示"JQQD"提示,有商品则隐藏(默认隐藏)</summary>
|
||||
private void UpdateJQQD()
|
||||
{
|
||||
if (JQQD == null) return;
|
||||
JQQD.SetActive(GetAliveItemCount() <= 0);
|
||||
}
|
||||
|
||||
/// <summary>统计背包里VIP经验类道具的总数量</summary>
|
||||
private int GetBackPackVipExpCount()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user