上传UI信息和替换,修正战斗页面的UI处理
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user