This commit is contained in:
2026-07-08 20:49:22 +08:00
parent 1989ada6a0
commit 47740fc859
31 changed files with 475 additions and 1442 deletions
@@ -269,12 +269,6 @@ MonoBehaviour:
- FLZY
- FishPrefab
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 5d67245a73fb5024fb90af6f339863d6
m_Address: Assets/Art/FengLei
m_ReadOnly: 0
m_SerializedLabels:
- Resources
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 628d6c681bbf87f449e839c4e81003f6
m_Address: Assets/Art/FengLei/bundles/by_fish_base/bundles/prefab/fishbase@/25.prefab
m_ReadOnly: 0
@@ -108,12 +108,6 @@ MonoBehaviour:
- FishPrefab
- YYSC
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 288c0597e267bbb4db2b0c2565fa27b9
m_Address: Assets/Art/YYSC
m_ReadOnly: 0
m_SerializedLabels:
- Resources
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 2ace7fe0ce83e334e879af741732e751
m_Address: Assets/MyGame/aa/Game/YYSC/Monster/renzheshenguijiangshi.prefab
m_ReadOnly: 0
+1 -136
View File
@@ -6765,7 +6765,6 @@ RectTransform:
- {fileID: 1819495571}
- {fileID: 3182697403238626235}
- {fileID: 1137879511}
- {fileID: 1281320455}
- {fileID: 4727940489469859465}
- {fileID: 4683725053833302880}
- {fileID: 1804551267}
@@ -6868,7 +6867,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1137879511
RectTransform:
m_ObjectHideFlags: 0
@@ -8281,140 +8280,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1277176622}
m_CullTransparentMesh: 1
--- !u!1001 &1281320454
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1096182889}
m_Modifications:
- target: {fileID: 3239626154716872945, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4870890971057883554, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5615636425683840664, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_Name
value: TurretPanel
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: aab7adfb6126f094f8860d975314558b, type: 3}
--- !u!224 &1281320455 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 8904622048228621647, guid: aab7adfb6126f094f8860d975314558b,
type: 3}
m_PrefabInstance: {fileID: 1281320454}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1312826143
GameObject:
m_ObjectHideFlags: 0
+2
View File
@@ -161,6 +161,7 @@ namespace Assets.MyGame.Scripts.Net
// ---------------- Rank ----------------
dic_API[APIType.Rank_GetUserList] = "/api/User/GetUserList";
dic_API[APIType.Hall_GetRanking] = "/api/Hall/GetRanking";
dic_API[APIType.Hall_GetChessRoomPartitionCount] = "/api/Hall/GetChessRoomPartitionCount";
// ---------------- Customer ----------------
dic_API[APIType.Customer_Start] = "/customerapi/Customer/start";
@@ -171,6 +172,7 @@ namespace Assets.MyGame.Scripts.Net
dic_API[APIType.Customer_Online] = "/customerapi/Customer/online";
dic_API[APIType.Customer_Status] = "/customerapi/Customer/status";
dic_API[APIType.Customer_ChatLog] = "/customerapi/Customer/chatlog/{conversationId}";
dic_API[APIType.Customer_MyConversations] = "/customerapi/Customer/my-conversations";
}
// ---------------- GET ----------------
@@ -110,6 +110,16 @@ namespace Assets.MyGame.Scripts.Net
}, callback);
}
/// <summary>
/// 获取我的会话列表(含消息历史)
/// GET /customerapi/Customer/my-conversations
/// 返回:List<MyConversationInfo>
/// </summary>
public static void GetMyConversations(Action<List<MyConversationInfo>> callback)
{
APIManager.Response<List<MyConversationInfo>>(APIType.Customer_MyConversations, callback);
}
/// <summary>
/// 上传客服图片(POST,multipart/form-data)
/// 参数:file(文件二进制)
@@ -287,6 +287,15 @@ namespace Assets.MyGame.Scripts.Net
APIManager.Response<RankingResponse>(APIType.Hall_GetRanking, req, callback);
}
/// <summary>
/// 获取象棋分区总数(GET,无参)
/// 返回:int
/// </summary>
public static void GetChessRoomPartitionCount(Action<int> callback)
{
APIManager.Response<int>(APIType.Hall_GetChessRoomPartitionCount, callback);
}
#endregion
}
}
@@ -185,4 +185,18 @@ namespace Assets.MyGame.Scripts.Net.APIResponses.Customer_SubClass
/// </summary>
public string createTime;
}
/// <summary>
/// 我的会话(含消息列表)
/// GET /customerapi/Customer/my-conversations
/// </summary>
[Serializable]
public class MyConversationInfo
{
public string id;
public string userId;
public string customerId;
public int status;
public List<CustomerMessageInfo> messages;
}
}
@@ -80,5 +80,10 @@ namespace Assets.MyGame.Scripts.Net.API
/// 象棋配置
/// </summary>
public ChessConfig chessConfig;
/// <summary>
/// 捕鱼房间配置
/// </summary>
public FishRoomConfig fishRoomConfig;
}
}
@@ -26,9 +26,9 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
{
public int level;
public int exp;
public GiftConfig normalGift;
public GiftConfig luxuryGift;
public GiftConfig supremeGift;
public List<GiftConfig> normalGiftList;
public List<GiftConfig> luxuryGiftList;
public List<GiftConfig> supremeGiftList;
public int payType;
public int payCount;
}
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
{
/// <summary>
/// 捕鱼房间配置
/// Swagger: FishRoomConfig
/// </summary>
[Serializable]
public class FishRoomConfig
{
/// <summary>
/// 手动选座限制(1=vip 2=代理商 3=普通用户)<br/>
/// 为 null 或空列表时不做限制
/// </summary>
public List<int> seatSelectLimit;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9d05c0727140f614db49548dc8127105
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -252,12 +252,9 @@ namespace Assets.MyGame.Scripts.Net.APIResponses
{
public int level;
public int exp;
public int normalGiftType;
public int normalGiftCount;
public int luxuryGiftType;
public int luxuryGiftCount;
public int supremeGiftType;
public int supremeGiftCount;
public List<GiftConfig> normalGiftList;
public List<GiftConfig> luxuryGiftList;
public List<GiftConfig> supremeGiftList;
}
[Serializable]
@@ -294,11 +291,11 @@ namespace Assets.MyGame.Scripts.Net.APIResponses
public string id;
public string userId;
public string number;
public string remark;
public string remark; // 任务描述
public int taskType; // 任务类型
public int taskEvent; // 任务事件
public int taskCount; // 任务次数要求
public int count; // 当前完成次数
public double count; // 当前完成次数(number 类型)
public bool isFinish; // 是否完成
public string otherId;
public bool isGet; // 是否已领取
+6
View File
@@ -327,6 +327,9 @@ namespace Assets.MyGame.Scripts.Net
/// <summary>获取用户排行榜(GET) type: 1=金币 2=等级 3=今日消耗</summary>
Hall_GetRanking,
/// <summary>获取象棋分区总数(GET)</summary>
Hall_GetChessRoomPartitionCount,
// ---------------- Customer ----------------
/// <summary>发起会话(POST)</summary>
@@ -352,5 +355,8 @@ namespace Assets.MyGame.Scripts.Net
/// <summary>获取聊天记录(GET)</summary>
Customer_ChatLog,
/// <summary>获取我的会话列表(含消息)GET</summary>
Customer_MyConversations,
}
}
@@ -43,7 +43,7 @@ public class BotSkillConfig
[Space]
[Header("锁定 - 自动瞄准最近鱼")]
[Range(0f, 1f)] public float lockProb = 0.7f;
[Range(0f, 1f)] public float lockProb = 0f;
public float lockMinTime = 5f;
public float lockMaxTime = 20f;
@@ -70,7 +70,7 @@ namespace Assets.MyGame.Scripts.Net
case SocketType.game:
break;
case SocketType.chess:
WebSocketSendList.GetRoomListChineseChess(1);
UIManager.Instance.Get<ChineseChessMainPanel>(UIPanel.MainGamePanelZGXQ).subUIManager.ShowAsync(UIPanel.ZGXQDistrict);
break;
case SocketType.customer:
break;
@@ -107,6 +107,10 @@ namespace Assets.MyGame.Scripts.Net
break;
case SocketType.chess:
//WebSocketSendList.GetRoomListChineseChess(1);
//UIManager.Instance.Get<ChineseChessMainPanel>(UIPanel.MainGamePanelZGXQ).subUIManager.ShowAsync(UIPanel.ZGXQDistrict);
UIManager.Instance.ShowAsync(UIPanel.MainGamePanelZGXQ);
break;
case SocketType.customer:
break;
+1 -1
View File
@@ -972,7 +972,7 @@ MonoBehaviour:
giftPrefab: {fileID: 322732254292001805}
giftPrefabParent: {fileID: 5708383959453866398}
sprite_Gold: {fileID: 21300000, guid: f913511fd7e863d45ac93b62c7fd4354, type: 3}
sprite_Diamond: {fileID: 21300000, guid: f913511fd7e863d45ac93b62c7fd4354, type: 3}
sprite_Diamond: {fileID: 21300000, guid: fb8cf8f90dbe44b41b021f64c8d08a56, type: 3}
btn_Get: {fileID: 7759498890616408438}
maskMat: {fileID: 2100000, guid: 16fb6fc82be36a540a74d11f90c0db6b, type: 2}
eraseMat: {fileID: 2100000, guid: 3261f5202cdff64409572045cc75834c, type: 2}
File diff suppressed because it is too large Load Diff
@@ -2750,7 +2750,19 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 8211565708645173749}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 3126247594640834412}
m_TargetAssemblyTypeName: TMPro.TMP_InputField, Unity.TextMeshPro
m_MethodName: set_text
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &7501219224753447274
GameObject:
m_ObjectHideFlags: 0
@@ -144,6 +144,7 @@ public class ChineseChessMainPanel : GameMainPanel_Base
// 房主点击开始 → 隐藏开始按钮,弹出金币设置
btn_StartGame.gameObject.SetActive(false);
StopWaitCountdown();
subUIManager.ShowAsync(UIPanel.ZGXQSelectCoin, chessGameRoom);
StartWaitCountdown(60, CountdownType.WaitSetCoin, "等待设置金额");
});
@@ -211,9 +212,6 @@ public class ChineseChessMainPanel : GameMainPanel_Base
if (img_DengDaiZhong != null)
{
img_DengDaiZhong.gameObject.SetActive(active);
// 控制父对象的父对象
if (img_DengDaiZhong.transform.parent != null && img_DengDaiZhong.transform.parent.parent != null)
img_DengDaiZhong.transform.parent.parent.gameObject.SetActive(active);
}
}
public void IsShowHint(string id,int type)
@@ -43,14 +43,15 @@ public class UIChineseChessDistrict : SubUIBase
base.OnShow(args);
tmp_CurrGold.text = GameManager.Instance.user.assets.gold.ToString();
// 从后端配置读取分区数
maxDistrict = GameManager.Instance?.gameConfig?.chessConfig?.districtCount ?? 10;
if (maxDistrict <= 0) maxDistrict = 1;
if (!_tabsBuilt)
{
BuildChessFenQuTabs();
_tabsBuilt = true;
// 从后端 API 获取分区总数
APIRequestList.GetChessRoomPartitionCount(count =>
{
maxDistrict = count > 0 ? count : 1;
BuildChessFenQuTabs();
_tabsBuilt = true;
});
}
}
@@ -130,7 +131,11 @@ public class UIChineseChessDistrict : SubUIBase
var tab = Instantiate(tra_FenQuItem, tra_DaQuParent);
// child0 = Toggle容器, child0.child0 = TextMeshProUGUI
if (tab.childCount > 0 && tab.GetChild(0) != null && tab.GetChild(0).childCount > 0)
{
tab.GetChild(0).GetChild(0).GetComponent<TextMeshProUGUI>().text = "象棋" + ToChineseNumber(d) + "区";
tab.GetChild(0).GetChild(2).GetComponent<TextMeshProUGUI>().text = "象棋" + ToChineseNumber(d) + "区";
}
int district = d;
var toggle = tab.GetChild(0).GetComponent<Toggle>();
@@ -157,6 +162,18 @@ public class UIChineseChessDistrict : SubUIBase
});
}
}
// 默认选中一区
if (tra_DaQuParent.childCount > 0)
{
var firstTab = tra_DaQuParent.GetChild(0);
if (firstTab.childCount > 0)
{
var firstToggle = firstTab.GetChild(0).GetComponent<Toggle>();
if (firstToggle != null)
firstToggle.isOn = true;
}
}
}
private static string ToChineseNumber(int n)
@@ -12,13 +12,19 @@ public class UIChineseChessSetCoin : SubUIBase
public TMP_InputField tmpInput_Coin;
public Button btn_Enter;
public List<Button> jinerList; // 金额按钮列表 子对象第0个是textmeshprougui 设置金额 这里有6个按钮
int currOnClicdindex=999;
private ChineseChessGameClassList.ChessGameRoom roomData;
public override void Awake()
{
base.Awake();
btn_Close.onClick.AddListener(() =>
{
WebSocketSendList.EndGameChineseChess(roomData.roomId, null);
uIManager.CloseAll();
WebSocketSendList.GetRoomListChineseChess(1);
});
}
public override void Show(object args = null)
{
@@ -49,9 +55,19 @@ public class UIChineseChessSetCoin : SubUIBase
long captured = amount;
jinerList[i].onClick.RemoveAllListeners();
int a = i;
jinerList[i].onClick.AddListener(() =>
{
tmpInput_Coin.text = captured.ToString();
//if (currOnClicdindex == 999|| currOnClicdindex != a)
//{
// currOnClicdindex = a;
// tmpInput_Coin.text = captured.ToString();
//}
//else if (currOnClicdindex == a)
//{
tmpInput_Coin.text = (Convert.ToInt32(tmpInput_Coin.text) + captured).ToString();
//}
});
}
}
+36 -36
View File
@@ -157,7 +157,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &248550254148260210
CanvasRenderer:
@@ -230,7 +230,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -238,7 +238,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -250,7 +250,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -801,7 +801,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: -2.0000126}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &6636842425468650203
CanvasRenderer:
@@ -874,7 +874,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -882,7 +882,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -894,7 +894,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -935,7 +935,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: -3.000001}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &527341910203846444
CanvasRenderer:
@@ -1008,7 +1008,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -1016,7 +1016,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -1028,7 +1028,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -1739,7 +1739,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: -2.0000126}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &2572262241010242586
CanvasRenderer:
@@ -1812,7 +1812,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -1820,7 +1820,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -1832,7 +1832,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -3681,7 +3681,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &9128762407081341286
CanvasRenderer:
@@ -3754,7 +3754,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -3762,7 +3762,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -3774,7 +3774,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -4902,7 +4902,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: -2.0000126}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &4548090218147094698
CanvasRenderer:
@@ -4975,7 +4975,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -4983,7 +4983,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -4995,7 +4995,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -7682,7 +7682,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: -2.0000126}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &3012206462264818238
CanvasRenderer:
@@ -7755,7 +7755,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -7763,7 +7763,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -7775,7 +7775,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -8614,7 +8614,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: -2.0000126}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &651052957954301749
CanvasRenderer:
@@ -8687,7 +8687,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -8695,7 +8695,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -8707,7 +8707,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -9020,7 +9020,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: -2.0000126}
m_SizeDelta: {x: 195.61664, y: 37}
m_SizeDelta: {x: 0, y: 37}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &481274404729623347
CanvasRenderer:
@@ -9093,7 +9093,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -9101,7 +9101,7 @@ MonoBehaviour:
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@@ -9113,7 +9113,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 61.29794, y: 0, z: 53.430824, w: 0}
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
+1 -1
View File
@@ -9626,7 +9626,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8080764192948249401}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
@@ -200,7 +200,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 123
m_text: "\u5165\u573A: 10000\u91D1\u5E01"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 7cb7af7685a457443a295fdaa17beeea, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 6a4ac15267282aa4790bdbb1dbbd6a3a, type: 2}
@@ -227,11 +227,11 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 30
m_fontSize: 20.85
m_fontSizeBase: 30
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_enableAutoSizing: 1
m_fontSizeMin: 15
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
@@ -263,7 +263,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_margin: {x: 20.08966, y: 0, z: 21.271423, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -114258,7 +114258,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 123
m_text: "\u5165\u573A: 11{0:N0} \u91D1\u5E01"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 7cb7af7685a457443a295fdaa17beeea, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 6a4ac15267282aa4790bdbb1dbbd6a3a, type: 2}
@@ -114285,11 +114285,11 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 30
m_fontSize: 18
m_fontSizeBase: 30
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_enableAutoSizing: 1
m_fontSizeMin: 15
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
@@ -114321,7 +114321,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_margin: {x: 23.558563, y: 0, z: 23.035034, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -198858,6 +198858,7 @@ MonoBehaviour:
ui_Default: {fileID: 6228432943795781098}
panel_UIHome_BY_MySelectRoomPenel: {fileID: 7418301694399300524}
currGameType: 0
leave: 1
isMySelectRoom: 0
subCameras:
- {fileID: 5034516898746802781}
@@ -199355,7 +199356,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 123
m_text: "\u5165\u573A: 100000\u91D1\u5E01000"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 7cb7af7685a457443a295fdaa17beeea, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 6a4ac15267282aa4790bdbb1dbbd6a3a, type: 2}
@@ -199382,11 +199383,11 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 30
m_fontSize: 15.65
m_fontSizeBase: 30
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_enableAutoSizing: 1
m_fontSizeMin: 15
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
@@ -199418,7 +199419,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_margin: {x: 29.080048, y: 0, z: 14.04715, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -38,6 +38,17 @@ public class UIHome_BY_SelectRoomLevelPanel : SubUIBase
public bool isMySelectRoom=false;
public List<Camera> subCameras;
/// <summary>检查当前用户是否有手动选座权限</summary>
private bool CanSelectRoom()
{
var limit = GameManager.Instance?.gameConfig?.fishRoomConfig?.seatSelectLimit;
if (limit == null || limit.Count == 0) return true; // 没配限制,默认允许
// 用户身份:vipLevel > 0 → 1(VIP),否则 3(普通)
int userType = GameManager.Instance.user.assets.vipLevel > 0 ? 1 : 3;
return limit.Contains(userType);
}
public override void Awake()
{
@@ -164,18 +175,21 @@ public class UIHome_BY_SelectRoomLevelPanel : SubUIBase
MySelectRoom1.onClick.AddListener(() =>
{
if (!CanSelectRoom()) { UIManager.Instance.ShowBoardError("无选座权限"); return; }
isMySelectRoom = true;
leave = 1;
OnSelectRoom(leave);
});
MySelectRoom2.onClick.AddListener(() =>
{
if (!CanSelectRoom()) { UIManager.Instance.ShowBoardError("无选座权限"); return; }
isMySelectRoom = true;
leave = 2;
OnSelectRoom(leave);
});
MySelectRoom3.onClick.AddListener(() =>
{
if (!CanSelectRoom()) { UIManager.Instance.ShowBoardError("无选座权限"); return; }
isMySelectRoom = true;
leave = 3;
OnSelectRoom(leave);
@@ -1,5 +1,5 @@
using Assets.MyGame.Scripts.Net;
using Assets.MyGame.Scripts.Net.APIRequest.Objs;
using Assets.MyGame.Scripts.Net.APIResponses.Customer_SubClass;
using Assets.MyGame.Scripts.Net.WebResponses;
using System;
using System.Collections;
@@ -16,44 +16,14 @@ public class UIHome_BY_ServicePanel : SubUIBase
[Header("客服")]
public TMP_InputField tMPInput_Text;
public DialogItem dialogGreenPrefab; // 用户消息(showAvatar=true)
public DialogItem dialogOrangePrefab; // 客服消息(showAvatar=false)
public DialogItem dialogGreenPrefab;
public DialogItem dialogOrangePrefab;
public Transform dialogPrefabParent;
public Button btn_SendText;
public string conversationId;
/// <summary>guid → 用户发送的气泡(用于状态更新)</summary>
Dictionary<string, DialogItem> dic_dialogItems = new Dictionary<string, DialogItem>();
// ==================== WebSocket 回调 ====================
/// <summary>用户消息发送确认 / 客服新消息</summary>
public void OnMessageReceived(CustomerMessageReceived msg)
{
if (msg.senderType == 1)
{
// 用户自己的消息发送成功 → 隐藏等待图标
if (!string.IsNullOrEmpty(msg.guid) && dic_dialogItems.TryGetValue(msg.guid, out var item))
{
if (item.waitMessage != null)
item.waitMessage.SetActive(false);
}
}
else
{
// 客服发来的新消息 → 创建橙色气泡,不显示头像
var orange = Instantiate(dialogOrangePrefab, dialogPrefabParent);
orange.showAvatar = false;
orange.SetMessage(msg.content);
ScrollToBottom();
}
}
/// <summary>发起会话回调</summary>
public void OnConversationStarted(CustomerConversationStartedResult result)
{
conversationId = result.conversation.id;
}
private bool _historyLoaded = false;
// ==================== 生命周期 ====================
@@ -63,26 +33,106 @@ public class UIHome_BY_ServicePanel : SubUIBase
btn_Close.onClick.RemoveAllListeners();
btn_Close.onClick.AddListener(() => uIManager.Close(UIPanel.ServicePanel));
WebSocketManager.Instance.Connect(SocketType.customer, () =>
{
WebSocketSendList.Customer_StartConversation(
GameManager.Instance.user.id,
GameManager.Instance.user.BaseInfo.userName
);
WebSocketSendList.Customer_JoinCustomerQueue(conversationId);
});
toggle_DefaultQuestion.onValueChanged.AddListener((a) =>
{
if (a)
{
//APIRequestList.GetOnlineCustomers
}
});
// 连接 Socket(仅收发实时消息,不再 StartConversation)
WebSocketManager.Instance.Connect(SocketType.customer, null);
toggle_DefaultQuestion.onValueChanged.AddListener((a) => { if (a) { } });
btn_SendText.onClick.AddListener(SendMessage);
}
protected override void OnShow(object args = null)
{
base.OnShow(args);
// 拉取历史消息(只拉一次)
if (!_historyLoaded)
{
_historyLoaded = true;
LoadHistory();
}
}
// ==================== 加载历史 ====================
private void LoadHistory()
{
// 清空旧气泡
for (int i = dialogPrefabParent.childCount - 1; i >= 0; i--)
Destroy(dialogPrefabParent.GetChild(i).gameObject);
dic_dialogItems.Clear();
APIRequestList.GetMyConversations(list =>
{
if (list != null && list.Count > 0)
{
var conv = list[0];
conversationId = conv.id;
// 显示历史消息(倒序逐一创建气泡)
if (conv.messages != null)
{
foreach (var msg in conv.messages)
{
AddHistoryBubble(msg);
}
ScrollToBottom();
}
}
});
}
private void AddHistoryBubble(CustomerMessageInfo msg)
{
if (msg.senderType == 1)
{
// 用户消息
var green = Instantiate(dialogGreenPrefab, dialogPrefabParent);
green.showAvatar = true;
green.SetMessage(msg.content);
}
else
{
// 客服消息
var orange = Instantiate(dialogOrangePrefab, dialogPrefabParent);
orange.showAvatar = false;
orange.SetMessage(msg.content);
}
}
// ==================== WebSocket 回调 ====================
public void OnMessageReceived(CustomerMessageReceived msg)
{
// 首次消息 → 获取 conversationId
if (string.IsNullOrEmpty(conversationId) && !string.IsNullOrEmpty(msg.conversationId))
conversationId = msg.conversationId;
if (msg.senderType == 1)
{
// 自己发的消息确认 → 隐藏等待图标
if (!string.IsNullOrEmpty(msg.guid) && dic_dialogItems.TryGetValue(msg.guid, out var item))
{
if (item.waitMessage != null)
item.waitMessage.SetActive(false);
}
}
else
{
// 客服新消息
var orange = Instantiate(dialogOrangePrefab, dialogPrefabParent);
orange.showAvatar = false;
orange.SetMessage(msg.content);
ScrollToBottom();
}
}
public void OnConversationStarted(CustomerConversationStartedResult result)
{
conversationId = result.conversation.id;
}
// ==================== 发送消息 ====================
private void SendMessage()
{
if (string.IsNullOrEmpty(tMPInput_Text.text.Trim()))
@@ -94,7 +144,7 @@ public class UIHome_BY_ServicePanel : SubUIBase
var content = tMPInput_Text.text.Trim();
tMPInput_Text.text = "";
// 创建绿色气泡(用户消息,显示头像)
// 绿色气泡
var green = Instantiate(dialogGreenPrefab, dialogPrefabParent);
green.showAvatar = true;
green.SetMessage(content);
@@ -102,7 +152,8 @@ public class UIHome_BY_ServicePanel : SubUIBase
string guid = Guid.NewGuid().ToString();
WebSocketSendList.Customer_SendMessage(
conversationId, 1,
conversationId ?? "", // 首次发传空串,服务端自动创建
1,
GameManager.Instance.user.id,
GameManager.Instance.user.BaseInfo.userName,
null, 1, content, guid
@@ -112,7 +163,8 @@ public class UIHome_BY_ServicePanel : SubUIBase
private void OnDestroy()
{
WebSocketSendList.Customer_LeaveConversation(conversationId);
if (!string.IsNullOrEmpty(conversationId))
WebSocketSendList.Customer_LeaveConversation(conversationId);
WebSocketManager.Instance.Close(SocketType.customer);
}
+53 -47
View File
@@ -183,9 +183,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1745957426307023230}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 218.69995, y: 335}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 195.69995, y: 129}
m_SizeDelta: {x: 36, y: 39}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1285998322400644702
@@ -2747,10 +2747,10 @@ RectTransform:
- {fileID: 9078475251665849206}
m_Father: {fileID: 4008272351016551106}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &773566001390805352
GameObject:
@@ -3245,10 +3245,10 @@ RectTransform:
- {fileID: 2051722366652840249}
m_Father: {fileID: 4008272351016551106}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1624, y: 750}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6892421314744955707
CanvasRenderer:
@@ -7588,9 +7588,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 4469160801082465297}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -707.5, y: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 104.5, y: 0}
m_SizeDelta: {x: 1, y: 750}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &768153561514109165
@@ -8845,10 +8845,10 @@ RectTransform:
- {fileID: 4459725723254797737}
m_Father: {fileID: 4008272351016551106}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1624, y: 750}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &579953404613919612
CanvasRenderer:
@@ -11102,7 +11102,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 02e1c92d0e18eac4bb47516edca65ebe, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
@@ -12515,9 +12515,9 @@ RectTransform:
- {fileID: 2448360251086208058}
m_Father: {fileID: 8650761888241340838}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -16.499, y: 119}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 203.501, y: -219}
m_SizeDelta: {x: 196, y: 438}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1888791775774577052
@@ -14533,6 +14533,8 @@ MonoBehaviour:
img_ZhiZunLocal: {fileID: 4908228247286929228}
tmp_ZhiZunPropCount: {fileID: 5372547274870681584}
tmp_currLevel: {fileID: 1548048096998792596}
sprite_Gold: {fileID: 0}
sprite_Diamond: {fileID: 0}
--- !u!1 &4226332020603464705
GameObject:
m_ObjectHideFlags: 0
@@ -14907,10 +14909,10 @@ RectTransform:
- {fileID: 5563143443156855268}
m_Father: {fileID: 4805843542476982587}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 121.82602, y: -133.00145}
m_SizeDelta: {x: 1564.6866, y: 608.0879}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 121.82602, y: -133.00146}
m_SizeDelta: {x: 1564.6866, y: -141.91211}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5929481451095915912
CanvasRenderer:
@@ -15750,10 +15752,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 4805843542476982587}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -592.5, y: -37}
m_SizeDelta: {x: 439, y: 676}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 219.5, y: -37}
m_SizeDelta: {x: 439, y: -74}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7736262057831695693
CanvasRenderer:
@@ -21671,6 +21673,8 @@ MonoBehaviour:
img_ZhiZunLocal: {fileID: 3480563155218242293}
tmp_ZhiZunPropCount: {fileID: 4221848766627442506}
tmp_currLevel: {fileID: 2337044026528177313}
sprite_Gold: {fileID: 21300000, guid: f913511fd7e863d45ac93b62c7fd4354, type: 3}
sprite_Diamond: {fileID: 21300000, guid: fb8cf8f90dbe44b41b021f64c8d08a56, type: 3}
--- !u!1 &6008409797393569978
GameObject:
m_ObjectHideFlags: 0
@@ -23258,10 +23262,10 @@ RectTransform:
- {fileID: 5613499286820490239}
m_Father: {fileID: 8579095257828303313}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -592.5, y: -37}
m_SizeDelta: {x: 439, y: 676}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 219.5, y: -37}
m_SizeDelta: {x: 439, y: -74}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2035134874395669574
CanvasRenderer:
@@ -26908,6 +26912,8 @@ MonoBehaviour:
tmp_Level: {fileID: 8900623682585849961}
tmp_Exp: {fileID: 1047680223030018608}
slider_LevelExp: {fileID: 4660069166699375746}
sprite_Gold: {fileID: 21300000, guid: f913511fd7e863d45ac93b62c7fd4354, type: 3}
sprite_Diamond: {fileID: 21300000, guid: fb8cf8f90dbe44b41b021f64c8d08a56, type: 3}
levelGiftitemPrefab: {fileID: 1047101946899589180}
levelGiftitemParent: {fileID: 5436103631707523789}
levelGiftitem_100: {fileID: 8284596759256177780}
@@ -30549,9 +30555,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 4805843542476982587}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 705, y: 290.5}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -112, y: -93.5}
m_SizeDelta: {x: 36, y: 39}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1906060226291854620
@@ -32824,9 +32830,9 @@ RectTransform:
- {fileID: 3628993749638001744}
m_Father: {fileID: 872434796219670641}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -3, y: 149.5}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 47, y: -225.5}
m_SizeDelta: {x: 76, y: 77}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9180879430343726280
@@ -33635,10 +33641,10 @@ RectTransform:
- {fileID: 4800011299181156774}
m_Father: {fileID: 4805843542476982587}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -520.1, y: -31.631}
m_SizeDelta: {x: 363.3, y: 644.38}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 291.90002, y: -31.630997}
m_SizeDelta: {x: 363.3, y: -105.619995}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4680517756028304639
CanvasRenderer:
@@ -34493,9 +34499,9 @@ RectTransform:
- {fileID: 2930465206723574929}
m_Father: {fileID: 872434796219670641}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -3, y: 241.5}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 47, y: -133.5}
m_SizeDelta: {x: 76, y: 77}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8899948132024931242
@@ -35566,9 +35572,9 @@ RectTransform:
- {fileID: 4246782021974717188}
m_Father: {fileID: 4469160801082465297}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -644.5, y: 327.49988}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 167.5, y: -47.500122}
m_SizeDelta: {x: 333, y: 93}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4634569855216913289
@@ -30,26 +30,23 @@ public class LevelGiftitem : MonoBehaviour
public TextMeshProUGUI tmp_ZhiZunPropCount;
public TextMeshProUGUI tmp_currLevel;
public void Init(string urlMianFei,int mianFeiPropCount, string urlJingYing,int jingYingPropCount, string urlZhiZun,int zhiZunPropCount,int currLevel, LevelGiftType giftType,bool showDuiGou)
public Sprite sprite_Gold;
public Sprite sprite_Diamond;
public void Init(string urlMianFei, int mianFeiPropCount, string urlJingYing, int jingYingPropCount,
string urlZhiZun, int zhiZunPropCount, int currLevel, LevelGiftType giftType, bool showDuiGou,
int normalGiftType = 0, int luxuryGiftType = 0, int supremeGiftType = 0)
{
WebTool.DownImage(APIManager.baseURL+ urlMianFei, (texture) =>
{
img_MianFei.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
});
WebTool.DownImage(APIManager.baseURL + urlJingYing, (texture) =>
{
img_JingYing.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
});
WebTool.DownImage(APIManager.baseURL + urlZhiZun, (texture) =>
{
img_ZhiZun.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
});
SetGiftImage(img_MianFei, urlMianFei, normalGiftType);
SetGiftImage(img_JingYing, urlJingYing, luxuryGiftType);
SetGiftImage(img_ZhiZun, urlZhiZun, supremeGiftType);
tmp_MianFeiPropCount.text = mianFeiPropCount.ToString();
tmp_JingYingPropCount.text = jingYingPropCount.ToString();
tmp_ZhiZunPropCount.text = zhiZunPropCount.ToString();
if ((giftType & LevelGiftType.MianFei) != 0)
{
if (showDuiGou)
if (showDuiGou)
img_MianFeiDuiGou.gameObject.SetActive(true);
}
if ((giftType & LevelGiftType.JingYing) != 0)
@@ -66,4 +63,25 @@ public class LevelGiftitem : MonoBehaviour
}
tmp_currLevel.text = currLevel.ToString();
}
private void SetGiftImage(Image target, string url, int giftType)
{
if (target == null) return;
if (giftType == 1 && sprite_Gold != null)
{
target.sprite = sprite_Gold;
}
else if (giftType == 2 && sprite_Diamond != null)
{
target.sprite = sprite_Diamond;
}
else if (!string.IsNullOrEmpty(url))
{
WebTool.DownImage(APIManager.baseURL + url, texture =>
{
target.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
});
}
}
}
+67 -38
View File
@@ -53,6 +53,7 @@ public class ZhanLing_Panel : SubUIBase
private BattleOrderConfigInfo _config;
private UserBattleOrderInfo _userData;
private int _selectedBuyLevel;
private List<BattleOrderLevelConfig> _buyLevelConfigs; // 含 payType/payCount
public Toggle toggle_HD;
public Toggle toggle_GG;
@@ -94,6 +95,11 @@ public class ZhanLing_Panel : SubUIBase
RefreshBuyPage();
RefreshBtnLabels();
});
APIRequestList.GetBattleOrderConfig(cfg =>
{
if (cfg != null) _buyLevelConfigs = cfg.levelConfig;
});
}
// ==================== 等级奖励页面 ====================
@@ -162,18 +168,22 @@ public class ZhanLing_Panel : SubUIBase
item.gameObject.SetActive(true);
bool isClaimed = claimedSet.Contains(lv.level);
bool reachedLevel = lv.level <= level;
var nf = FirstGift(lv.normalGiftList);
var lx = FirstGift(lv.luxuryGiftList);
var sz = FirstGift(lv.supremeGiftList);
LevelGiftType giftType = 0;
if (lv.normalGiftType > 0) giftType |= LevelGiftType.MianFei;
if (lv.luxuryGiftType > 0 && _userData.isLuxury) giftType |= LevelGiftType.JingYing;
if (lv.supremeGiftType > 0 && _userData.isSupreme) giftType |= LevelGiftType.ZhiZun;
if (nf != null) giftType |= LevelGiftType.MianFei;
if (lx != null && _userData.isLuxury) giftType |= LevelGiftType.JingYing;
if (sz != null && _userData.isSupreme) giftType |= LevelGiftType.ZhiZun;
item.Init(
GetIconUrl(lv.normalGiftType), lv.normalGiftCount,
GetIconUrl(lv.luxuryGiftType), lv.luxuryGiftCount,
GetIconUrl(lv.supremeGiftType), lv.supremeGiftCount,
lv.level, giftType, isClaimed);
nf?.product?.imageUrl ?? "", nf?.count ?? 0,
lx?.product?.imageUrl ?? "", lx?.count ?? 0,
sz?.product?.imageUrl ?? "", sz?.count ?? 0,
lv.level, giftType, isClaimed,
nf?.type ?? 0, lx?.type ?? 0, sz?.type ?? 0);
}
// 100级礼包
@@ -182,15 +192,20 @@ public class ZhanLing_Panel : SubUIBase
{
bool isClaimed = claimedSet.Contains(_maxLevel);
var nf100 = FirstGift(lv100.normalGiftList);
var lx100 = FirstGift(lv100.luxuryGiftList);
var sz100 = FirstGift(lv100.supremeGiftList);
LevelGiftType giftType100 = LevelGiftType.MianFei;
if (lv100.luxuryGiftType > 0 && _userData.isLuxury) giftType100 |= LevelGiftType.JingYing;
if (lv100.supremeGiftType > 0 && _userData.isSupreme) giftType100 |= LevelGiftType.ZhiZun;
if (lx100 != null && _userData.isLuxury) giftType100 |= LevelGiftType.JingYing;
if (sz100 != null && _userData.isSupreme) giftType100 |= LevelGiftType.ZhiZun;
levelGiftitem_100.Init(
GetIconUrl(lv100.normalGiftType), lv100.normalGiftCount,
GetIconUrl(lv100.luxuryGiftType), lv100.luxuryGiftCount,
GetIconUrl(lv100.supremeGiftType), lv100.supremeGiftCount,
_maxLevel, giftType100, isClaimed);
nf100?.product?.imageUrl ?? "", nf100?.count ?? 0,
lx100?.product?.imageUrl ?? "", lx100?.count ?? 0,
sz100?.product?.imageUrl ?? "", sz100?.count ?? 0,
_maxLevel, giftType100, isClaimed,
nf100?.type ?? 0, lx100?.type ?? 0, sz100?.type ?? 0);
levelGiftitem_100.gameObject.SetActive(true);
}
}
@@ -209,8 +224,9 @@ public class ZhanLing_Panel : SubUIBase
if (tasks == null) return;
foreach (var t in tasks)
{
int curr = (int)t.count;
float progress = t.taskCount > 0 ? (float)t.count / t.taskCount : 0f;
CreateTaskItem(t.exp, t.count, t.taskCount, t.remark, progress, UIPanel.None);
CreateTaskItem(t.exp, curr, t.taskCount, t.remark, progress, UIPanel.None);
}
});
}
@@ -257,9 +273,9 @@ public class ZhanLing_Panel : SubUIBase
var cfg = _config?.levelConfig?.Find(c => c.level == level);
if (cfg == null) return;
AddBuyGiftByType(buyLevelGiftitemMianFeiParent, cfg.normalGiftType, cfg.normalGiftCount);
AddBuyGiftByType(buyLevelGiftitemJingYingParent, cfg.luxuryGiftType, cfg.luxuryGiftCount);
AddBuyGiftByType(buyLevelGiftitemZhiZunParent, cfg.supremeGiftType, cfg.supremeGiftCount);
AddBuyGiftList(buyLevelGiftitemMianFeiParent, cfg.normalGiftList);
AddBuyGiftList(buyLevelGiftitemJingYingParent, cfg.luxuryGiftList);
AddBuyGiftList(buyLevelGiftitemZhiZunParent, cfg.supremeGiftList);
}
private void ClearBuyGiftParent(Transform parent)
@@ -269,14 +285,20 @@ public class ZhanLing_Panel : SubUIBase
Destroy(parent.GetChild(i).gameObject);
}
private void AddBuyGiftByType(Transform parent, int giftType, int giftCount)
private void AddBuyGiftList(Transform parent, List<GiftConfig> gifts)
{
if (parent == null || giftType <= 0) return;
var obj = Instantiate(buyLevelGiftitemPrefab, parent);
// 1=金币 2=钻石 3=道具,金钻用本地图标
string url = "";
PropEnum pe = PropEnum.none;
obj.Init(url, giftCount, pe);
if (parent == null || gifts == null) return;
foreach (var gift in gifts)
{
var obj = Instantiate(buyLevelGiftitemPrefab, parent);
string url = !string.IsNullOrEmpty(gift.product?.imageUrl)
? APIManager.baseURL + gift.product.imageUrl
: "";
int type = gift.type;
PropEnum pe = type switch { 3 => (PropEnum)(gift.product?.type ?? 0), _ => PropEnum.none };
int count = gift.isRandom ? gift.minCount : gift.count;
obj.Init(url, count, pe);
}
}
private void UpdateBuyPrice()
@@ -290,18 +312,30 @@ public class ZhanLing_Panel : SubUIBase
}
else
{
// 计算从当前等级到目标等级所需总经验
// 计算从当前等级到目标等级所需总经验和总花费
int totalExp = 0;
if (_config?.levelConfig != null)
int totalCost = 0;
int costPayType = 2; // 默认钻石
if (_buyLevelConfigs != null)
{
for (int lv = _userData.level + 1; lv <= _selectedBuyLevel; lv++)
{
var cfg = _config.levelConfig.Find(c => c.level == lv);
if (cfg != null) totalExp += cfg.exp;
var cfg = _buyLevelConfigs.Find(c => c.level == lv);
if (cfg != null)
{
totalExp += cfg.exp;
totalCost += cfg.payCount;
if (cfg.payType > 0) costPayType = cfg.payType;
}
}
}
tmp_PriceNum.text = $"<sprite name=\"钻石\">{levelsToBuy * 100}";
tmp_PriceNum.text = costPayType switch
{
1 => $"<sprite name=\"金币\">{totalCost}",
3 => $"¥{totalCost}",
_ => $"<sprite name=\"钻石\">{totalCost}",
};
if (tmp_BuyLabel != null)
tmp_BuyLabel.text = $"购买<color=yellow> {totalExp} </color>点经验值升至 <color=green>{_selectedBuyLevel} </color>级";
btn_Buy.interactable = true;
@@ -419,15 +453,10 @@ public class ZhanLing_Panel : SubUIBase
// ==================== 工具 ====================
/// <summary>根据礼物类型返回图标路径(空串=金币/钻石用本地Sprite)</summary>
private static string GetIconUrl(int giftType)
/// <summary>取礼物列表第一项(列表为空返回 null)</summary>
private static GiftConfig FirstGift(List<GiftConfig> list)
{
return giftType switch
{
1 => "", // 金币 - 本地图标
2 => "", // 钻石 - 本地图标
_ => "", // 道具 - 本地图标
};
return (list != null && list.Count > 0) ? list[0] : null;
}
/// <summary>刷新战令剩余时间(格式:30天10:01:50)</summary>

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB