首页牌组初始化

This commit is contained in:
YiHan0621
2025-09-11 10:47:32 +08:00
parent 3a80559de9
commit 726e97a986
5 changed files with 187 additions and 47 deletions

View File

@@ -136,8 +136,7 @@ namespace TcgEngine.Gameplay
// 从服务器API获取任务配置
string url = ApiClient.ServerURL + "/api/tasks";
WebResponse res = await ApiClient.Get().SendGetRequest(url);
Debug.LogError("从服务器API获取任务配置" + res.data + res.status);
Debug.LogError(res.success);
Debug.Log("从服务器API获取任务配置" + res.data + res.status);
if (res.success)
{
// 解析任务配置数据
@@ -650,7 +649,7 @@ namespace TcgEngine.Gameplay
{
allTasks = Resources.LoadAll<TaskData>("Tasks");
}
var loginTask = allTasks.FirstOrDefault(t => t.isDailyTask && t.condition == TaskConditionType.LoginGame);
if (loginTask != null)

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TcgEngine.Client;
using TcgEngine.Gameplay;
using Unity.VisualScripting;
namespace TcgEngine.UI
@@ -42,6 +43,7 @@ namespace TcgEngine.UI
//Set default settings
Application.targetFrameRate = 120;
GameClient.game_settings = GameSettings.Default;
Debug.Log("WOWO_Awake");
}
private void Start()
@@ -62,6 +64,7 @@ namespace TcgEngine.UI
AfterLogin();
else
RefreshLogin();
// TaskManager.Instance.SavePlayerData();
}
void Update()
@@ -267,6 +270,17 @@ namespace TcgEngine.UI
StartMathmaking(GameMode.Ranked, "");
}
public void OnUiFrameShow(UIPanel panel)
{
if (!Authenticator.Get().IsConnected())
{
FadeToScene("LoginMenu");
return;
}
panel.Show();
}
public void OnClickAdventure()
{
AdventurePanel.Get().Show();

View File

@@ -6,8 +6,8 @@ using UnityEngine.UI;
namespace TcgEngine.UI
{
/// <summary>
/// Selection of your starter deck
/// Will only appear in the main menu when in API mode with a new account
/// 初始套牌选择
/// 仅当处于 API 模式且使用新账号时,才会在主菜单中显示
/// </summary>
public class StarterDeckPanel : UIPanel

View File

@@ -14,7 +14,7 @@ namespace TcgEngine.UI
{
public string group;
public bool active;
public GameObject highlight;
// public GameObject highlight;
public UIPanel ui_panel;
public UnityAction onClick;