This commit is contained in:
2026-08-09 17:57:46 +08:00
parent 316a83a6ac
commit 983192ba29
323 changed files with 32641 additions and 14505 deletions
@@ -2887,8 +2887,8 @@ MonoBehaviour:
toggle_QualityHigh: {fileID: 548545019360561504}
group_Quality: {fileID: 2633333811721842697}
toggle_Fps30: {fileID: 1920932423155590205}
toggle_Fps60: {fileID: 2695896144210334820}
toggle_FpsUnlimited: {fileID: 6215252191328535144}
toggle_Fps60: {fileID: 6215252191328535144}
toggle_FpsUnlimited: {fileID: 2695896144210334820}
group_Fps: {fileID: 2721460615196769330}
btn_ChangeUser: {fileID: 4110841028567726580}
--- !u!1 &3446973110227008176
@@ -195,7 +195,7 @@ public class UIHome_BY_EmailPanel : SubUIBase
}
if (email.rewardDiamond > 0)
{
list.Add(new BackPackPropItemData { giftType = 2, count = email.rewardDiamond });
list.Add(new BackPackPropItemData { giftType = 2, count = (int)email.rewardDiamond });
}
if (email.rewardItems != null)
{
@@ -25,6 +25,9 @@ public class UIHome_BY_ServicePanel : SubUIBase
Dictionary<string, DialogItem> dic_dialogItems = new Dictionary<string, DialogItem>();
private bool _historyLoaded = false;
/// <summary>游客模式下生成的临时用户id(登录界面无user时使用)</summary>
private string _guestUserId;
// ==================== 生命周期 ====================
public override void Awake()
@@ -33,6 +36,10 @@ public class UIHome_BY_ServicePanel : SubUIBase
btn_Close.onClick.RemoveAllListeners();
btn_Close.onClick.AddListener(() => uIManager.Close(UIPanel.ServicePanel));
// 游客模式(登录界面无user):生成临时身份
if (GameManager.Instance.user == null)
_guestUserId = Guid.NewGuid().ToString();
// 连接 Socket(仅收发实时消息,不再 StartConversation)
WebSocketManager.Instance.Connect(SocketType.customer, null);
@@ -151,11 +158,25 @@ public class UIHome_BY_ServicePanel : SubUIBase
ScrollToBottom();
string guid = Guid.NewGuid().ToString();
// 身份选择:有user用真实身份,无user(登录界面游客)用临时guid
string userId, userName;
if (GameManager.Instance.user != null)
{
userId = GameManager.Instance.user.id;
userName = GameManager.Instance.user.BaseInfo.userName;
}
else
{
userId = _guestUserId;
userName = _guestUserId.Substring(_guestUserId.Length - 6);
}
WebSocketSendList.Customer_SendMessage(
conversationId ?? "", // 首次发传空串,服务端自动创建
1,
GameManager.Instance.user.id,
GameManager.Instance.user.BaseInfo.userName,
userId,
userName,
null, 1, content, guid
);
dic_dialogItems[guid] = green;
@@ -4,7 +4,6 @@ using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Serialization;
using UnityEngine.UI;
public class UIHome_BY_SettingPanel : SubUIBase
@@ -21,10 +20,8 @@ public class UIHome_BY_SettingPanel : SubUIBase
[Header("帧率")]
public Toggle toggle_Fps30;
[FormerlySerializedAs("toggle_Fps60")]
public Toggle toggle_Fps45;
[FormerlySerializedAs("toggle_FpsUnlimited")]
public Toggle toggle_Fps60;
public Toggle toggle_FpsUnlimited;
public ToggleGroup group_Fps;
private Dictionary<Toggle, Color> labelOriginalColors = new Dictionary<Toggle, Color>();
@@ -76,13 +73,13 @@ public class UIHome_BY_SettingPanel : SubUIBase
// 帧率
CacheToggleColor(toggle_Fps30);
CacheToggleColor(toggle_Fps45);
CacheToggleColor(toggle_Fps60);
CacheToggleColor(toggle_FpsUnlimited);
int fps = PlayerPrefs.GetInt("TargetFps", 1);
ApplyFps(fps);
toggle_Fps30?.onValueChanged.AddListener(a => { if (a) SetFps(0); });
toggle_Fps45?.onValueChanged.AddListener(a => { if (a) SetFps(1); });
toggle_Fps60?.onValueChanged.AddListener(a => { if (a) SetFps(2); });
toggle_Fps60?.onValueChanged.AddListener(a => { if (a) SetFps(1); });
toggle_FpsUnlimited?.onValueChanged.AddListener(a => { if (a) SetFps(2); });
}
protected override void OnShow(object args = null)
{
@@ -137,13 +134,13 @@ public class UIHome_BY_SettingPanel : SubUIBase
private void ApplyFps(int level)
{
if (toggle_Fps30 != null) toggle_Fps30.isOn = (level == 0);
if (toggle_Fps45 != null) toggle_Fps45.isOn = (level == 1);
if (toggle_Fps60 != null) toggle_Fps60.isOn = (level == 2);
if (toggle_Fps60 != null) toggle_Fps60.isOn = (level == 1);
if (toggle_FpsUnlimited != null) toggle_FpsUnlimited.isOn = (level == 2);
UpdateToggleColor(toggle_Fps30, level == 0);
UpdateToggleColor(toggle_Fps45, level == 1);
UpdateToggleColor(toggle_Fps60, level == 2);
UpdateToggleColor(toggle_Fps60, level == 1);
UpdateToggleColor(toggle_FpsUnlimited, level == 2);
// 中高档统一为 60 帧。移动端强制垂直同步,45 不可用(60Hz 整数倍才合法),
// 故中档(45)也直接按 60 处理,避免闪退。
// 故中档也直接按 60 处理,避免闪退。
switch (level)
{
case 0: Application.targetFrameRate = 30; break;
@@ -194,7 +194,7 @@ public class UserInfoPanel : SubUIBase
//slider_UserLevel.minValue = cfg.expMin;
slider_UserLevel.maxValue = cfg.expMax;
//slider_UserLevel.value = Mathf.Clamp(assets.exp, cfg.expMin, cfg.expMax);
slider_UserLevel.value = Mathf.Clamp(assets.exp, 0, cfg.expMax);
slider_UserLevel.value = Mathf.Clamp((float)assets.exp, 0, cfg.expMax);
}
// 经验数值
@@ -14,7 +14,7 @@ public class RenWuItem : MonoBehaviour
public Button lingQu; // 领取
public Button qianWang; // 前往
public void Init(int expCount, int currJinDu, int maxJinDu, string renWoLabel,
public void Init(long expCount, int currJinDu, int maxJinDu, string renWoLabel,
float jinDuValue, string taskId, bool isFinish, bool isGet,
UIPanel uIPanel, SubUIManager subUIManager, Action onClaimed = null)
{
@@ -118,9 +118,9 @@ public class ZhanLing_Panel : SubUIBase
if (_config?.levelConfig == null || _userData == null) return;
int level = _userData.level;
int exp = _userData.exp;
long exp = _userData.exp;
var lvCfg = _config.levelConfig.Find(c => c.level == level);
int expNeeded = lvCfg?.exp ?? 100;
long expNeeded = lvCfg?.exp ?? 100L;
tmp_Level.text = $"Lv.{level}";
tmp_Exp.text = $"<color=yellow>{exp}</color>/{expNeeded}";
@@ -240,7 +240,7 @@ public class ZhanLing_Panel : SubUIBase
}
private void CreateTaskItem(int expCount, int currJinDu, int maxJinDu, string label,
private void CreateTaskItem(long expCount, int currJinDu, int maxJinDu, string label,
float progress, string taskId, bool isFinish, bool isGet, UIPanel targetPanel)
{
var item = Instantiate(renWuItemPrefab, renWuItemParent);
@@ -411,7 +411,7 @@ public class ZhanLing_Panel : SubUIBase
else
{
// 计算从当前等级到目标等级所需总经验和总花费
int totalExp = 0;
long totalExp = 0;
int totalCost = 0;
int costPayType = 2; // 默认钻石
if (_buyLevelConfigs != null)