1
This commit is contained in:
@@ -181,6 +181,11 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
public Toggle toggle_Lock;
|
||||
public Toggle toggle_Three;
|
||||
public Toggle toggle_Shuang;
|
||||
// ⭐ 双倍开火:toggle_Shuang 开启后计时 shuangDuration 秒自动关闭(DaoJiShi 驱动),
|
||||
// child0 的 Image(Filled 360°) 做环形倒计时显示(GetShuangFillImage 懒获取)
|
||||
float shuangDuration = 15f;
|
||||
public float currShuangTime = 0f;
|
||||
private Image _shuangFillImage;
|
||||
public Toggle toggle_BaoZou;
|
||||
public TextMeshProUGUI tmp_BaoZouCount;
|
||||
public Image img_BaoZou;
|
||||
@@ -332,11 +337,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
}
|
||||
else
|
||||
{
|
||||
// ⭐ 各游戏prefab未拖拽加减倍按钮时为null,做保护(XJMH座位没有该按钮)
|
||||
if (item.btn_TurretAdd != null)
|
||||
item.btn_TurretAdd.gameObject.SetActive(false);
|
||||
if (item.btn_TurretMinus != null)
|
||||
item.btn_TurretMinus.gameObject.SetActive(false);
|
||||
// ⭐ 非本地座位隐藏加减炮倍:Normal 藏座位按钮(未拖引用为 null 跳过),
|
||||
// XJMH 藏炮台上的加减倍(TurretData.obj_Add / obj_Down)
|
||||
item.HideTurretAddMinusUI();
|
||||
// ⭐ 自动攻击开关与加减倍按钮一样:非本地座位隐藏
|
||||
if (item.toggle_AutoAttack != null)
|
||||
item.toggle_AutoAttack.gameObject.SetActive(false);
|
||||
@@ -823,6 +826,26 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
GameManager.Instance.user.id,
|
||||
"40003", 0);
|
||||
});
|
||||
// ⭐ 双倍开火开关:开启(重新)计时 15 秒 + 满环开始倒计时,关闭停表清环。
|
||||
// isDouble 不需要同步开关状态:每次开火随 SyncFire 的 twoRTruect 传给服务端,
|
||||
// 三处开火入口(TryFire/HandleAutoFire/OnFlyTurretUpwardFire)都实时读 isOn
|
||||
if (toggle_Shuang != null)
|
||||
{
|
||||
toggle_Shuang.onValueChanged.AddListener(on =>
|
||||
{
|
||||
var fill = GetShuangFillImage();
|
||||
if (on)
|
||||
{
|
||||
currShuangTime = shuangDuration;
|
||||
if (fill != null) fill.fillAmount = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
currShuangTime = 0f;
|
||||
if (fill != null) fill.fillAmount = 0f;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2503,6 +2526,33 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
if (_bingFengInstance != null) _bingFengInstance.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
// ⭐ 双倍开火倒计时:child0 的环形填充图(Image Filled 360°)随时间耗尽,
|
||||
// 15 秒后自动关闭。SetIsOnWithoutNotify 不触发 onValueChanged(避免重置计时逻辑);
|
||||
// 关闭后三处开火入口读 isOn=false,后续 SyncFire 的 twoRTruect 自动恢复单倍
|
||||
if (toggle_Shuang != null && toggle_Shuang.isOn && shuangDuration > 0)
|
||||
{
|
||||
var fill = GetShuangFillImage();
|
||||
if (fill != null)
|
||||
fill.fillAmount = Mathf.Clamp01(currShuangTime / shuangDuration);
|
||||
|
||||
currShuangTime -= Time.deltaTime;
|
||||
|
||||
if (currShuangTime <= 0)
|
||||
{
|
||||
toggle_Shuang.SetIsOnWithoutNotify(false);
|
||||
currShuangTime = 0f;
|
||||
if (fill != null) fill.fillAmount = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>toggle_Shuang.child0 的环形填充图(Image Filled 360°),首次调用懒获取并缓存</summary>
|
||||
private Image GetShuangFillImage()
|
||||
{
|
||||
if (_shuangFillImage == null && toggle_Shuang != null && toggle_Shuang.transform.childCount > 0)
|
||||
_shuangFillImage = toggle_Shuang.transform.GetChild(0).GetComponent<Image>();
|
||||
return _shuangFillImage;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -4152,7 +4202,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
// (RoomChangeResponse 用户列表,RoomInfo 消息下发),按 userId 查询
|
||||
var playerInfo = GameManager.Instance.gameData?.currRoomData?.players?
|
||||
.Find(p => p.userId == sit.user);
|
||||
sit.SetUserInfo(sit.user, playerInfo?.userName, playerInfo?.avatar, playerInfo?.vipLevel ?? 0, playerInfo?.userNumber);
|
||||
sit.SetUserInfo(sit.user, playerInfo?.userName, playerInfo?.avatar, playerInfo?.vipLevel ?? 0,
|
||||
playerInfo?.userNumber, playerInfo?.level ?? 0, playerInfo?.exp ?? 0f);
|
||||
|
||||
// ⭐ 记录金币流水:已加钱(进房设置初始金币,本地已执行)
|
||||
GameManager.LogGoldFlowAppliedGain("JoinGame", $"座位={sitNum} 初始金币={goldNum} 钻石={diamondNum} 炮台消耗={consumeGold} 房间={GameManager.Instance.gameData?.currRoomData?.roomId}");
|
||||
|
||||
Reference in New Issue
Block a user