上传UI信息和替换,修正战斗页面的UI处理

This commit is contained in:
YiHan0621
2025-09-26 14:32:52 +08:00
parent 25cf205770
commit eba34c083a
29 changed files with 615 additions and 672 deletions

View File

@@ -57,6 +57,9 @@ namespace TcgEngine.Gameplay
// 订阅游戏事件
gameClient = FindFirstObjectByType<GameClient>();
gameClient = GameClient.Get();
ApiClient client = ApiClient.Get();
if (gameClient != null)
{
LoadTasks();
@@ -65,6 +68,17 @@ namespace TcgEngine.Gameplay
gameClient.onGameEnd += OnGameEnd;
// gameClient.onConnectServer?.Invoke();
}
// else if (client.UserData != null)
// {
// LoadTasks();
// LoadPlayerData();
// client.onLogin += OnGameStart;
// client.onLogin += OnGameEnd;
// }
else
{
Debug.Log("绑定失败!");
}
// 移除对GameLogic.Instance的错误引用改为检查gameLogic变量
if (gameLogic != null)
@@ -548,6 +562,11 @@ namespace TcgEngine.Gameplay
UpdateTaskProgress(TaskConditionType.PlayGames);
}
private void OnGameStart(LoginResponse login)
{
UpdateTaskProgress(TaskConditionType.PlayGames);
}
private void OnGameEnd(int winner)
{
int player_id = GameClient.Get().GetPlayerID();