上传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();
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using TcgEngine;
|
||||
using TcgEngine.Gameplay;
|
||||
using TcgEngine.Client;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TcgEngine.Gameplay
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务管理器,负责任务的分配、进度追踪和奖励发放等功能
|
||||
/// </summary>
|
||||
public class TaskManagerGx : MonoBehaviour
|
||||
{
|
||||
public List<PlayerTask> PlayerTasks = new List<PlayerTask>();
|
||||
|
||||
public async void SavePayerData()
|
||||
{
|
||||
PlayerTasksResponse saveData = new PlayerTasksResponse();
|
||||
// PlayerTaskResponse[] taskResponses = new PlayerTaskResponse[ taskResponses.taskId="login_task_1",
|
||||
// assignedTime=1757067900,
|
||||
// taskResponses.expireTime=1757154300,
|
||||
// taskResponses.status=2,
|
||||
// taskResponses.progress=1]
|
||||
;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d388b20392c45e6b37f010373e2c729
|
||||
timeCreated: 1757061071
|
||||
Reference in New Issue
Block a user