漏上传,补充

This commit is contained in:
YiHan0621
2025-09-08 16:27:21 +08:00
parent 3467536386
commit 29ba23403b
6 changed files with 90 additions and 53 deletions

View File

@@ -28,6 +28,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 7582229092490914042} m_Father: {fileID: 7582229092490914042}
m_RootOrder: 0 m_RootOrder: 0
@@ -107,6 +108,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 7582229092490914042} m_Father: {fileID: 7582229092490914042}
m_RootOrder: 1 m_RootOrder: 1
@@ -185,6 +187,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 3371345542103985239} - {fileID: 3371345542103985239}
- {fileID: 7582229092255187381} - {fileID: 7582229092255187381}
@@ -359,12 +362,6 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3}
--- !u!224 &6672059157995478947 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091098844522}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2521591545803479578 stripped --- !u!114 &2521591545803479578 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4, m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
@@ -377,6 +374,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3} m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!224 &6672059157995478947 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091098844522}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7582229091224270575 --- !u!1001 &7582229091224270575
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -511,12 +514,6 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3}
--- !u!224 &6672059158925947942 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091224270575}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2521591545675968927 stripped --- !u!114 &2521591545675968927 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4, m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
@@ -529,6 +526,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3} m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!224 &6672059158925947942 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091224270575}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7582229091286495002 --- !u!1001 &7582229091286495002
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -663,12 +666,6 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3}
--- !u!224 &6672059158988172755 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091286495002}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2521591545722398826 stripped --- !u!114 &2521591545722398826 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4, m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
@@ -681,6 +678,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3} m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!224 &6672059158988172755 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091286495002}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7582229091326638487 --- !u!1001 &7582229091326638487
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -815,12 +818,6 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3}
--- !u!224 &6672059158890167134 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091326638487}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2521591545505971943 stripped --- !u!114 &2521591545505971943 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4, m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
@@ -833,6 +830,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3} m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!224 &6672059158890167134 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091326638487}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7582229091411733964 --- !u!1001 &7582229091411733964
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -967,12 +970,6 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3}
--- !u!224 &6672059158840782597 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091411733964}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2521591545590737596 stripped --- !u!114 &2521591545590737596 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4, m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
@@ -985,6 +982,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3} m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!224 &6672059158840782597 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091411733964}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7582229091563924092 --- !u!1001 &7582229091563924092
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1119,12 +1122,6 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3}
--- !u!224 &6672059158594775221 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091563924092}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2521591545210481932 stripped --- !u!114 &2521591545210481932 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4, m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
@@ -1137,6 +1134,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3} m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!224 &6672059158594775221 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091563924092}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7582229091617377000 --- !u!1001 &7582229091617377000
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1271,12 +1274,6 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 90f1aa482afcc9c4f87470c4d4557bc4, type: 3}
--- !u!224 &6672059158644033569 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091617377000}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2521591545259773336 stripped --- !u!114 &2521591545259773336 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4, m_CorrespondingSourceObject: {fileID: 5460336411350321008, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
@@ -1289,3 +1286,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3} m_Script: {fileID: 11500000, guid: 943be08264f3555448cac48ac16c1e8c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!224 &6672059158644033569 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3868195550748869321, guid: 90f1aa482afcc9c4f87470c4d4557bc4,
type: 3}
m_PrefabInstance: {fileID: 7582229091617377000}
m_PrefabAsset: {fileID: 0}

View File

@@ -9438,7 +9438,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 634882798} - component: {fileID: 634882798}
m_Layer: 5 m_Layer: 5
m_Name: "\u7ECF\u9A8C" m_Name: LevelProgress
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@@ -31020,7 +31020,7 @@ MonoBehaviour:
m_MinValue: 0 m_MinValue: 0
m_MaxValue: 1 m_MaxValue: 1
m_WholeNumbers: 0 m_WholeNumbers: 0
m_Value: 0.561 m_Value: 0.1
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@@ -32516,6 +32516,8 @@ MonoBehaviour:
credits_txt: {fileID: 1317959218} credits_txt: {fileID: 1317959218}
avatar: {fileID: 1120415714} avatar: {fileID: 1120415714}
loader: {fileID: 295344790} loader: {fileID: 295344790}
level_text: {fileID: 217392228}
level_slider: {fileID: 1958182121}
version_text: {fileID: 1975599770} version_text: {fileID: 1975599770}
deck_selector: {fileID: 1611943003454912994} deck_selector: {fileID: 1611943003454912994}
deck_preview: {fileID: 1940984899} deck_preview: {fileID: 1940984899}

View File

@@ -58,6 +58,17 @@ namespace TcgEngine
return Mathf.FloorToInt(xp / 1000) + 1; return Mathf.FloorToInt(xp / 1000) + 1;
} }
public float GetLevelProgress()
{
int currentLeve = GetLevel();
int baseXp = (currentLeve - 1) * 1000;
Debug.LogError(xp);
// 距离下一级还需多少经验值
int xpIntoCurrentLevel = xp - baseXp;
return (float)xpIntoCurrentLevel / 1000f;
}
public string GetAvatar() public string GetAvatar()
{ {
if (avatar != null) if (avatar != null)

View File

@@ -69,26 +69,35 @@ namespace TcgEngine
public class PlayerTask public class PlayerTask
{ {
public string taskId; public string taskId;
public DateTime assignedTime; public long assignedTime;
public DateTime expireTime; public long expireTime;
public TaskStatus status; public TaskStatus status;
public int progress; // 当前进度 public int progress; // 当前进度
public PlayerTask(TaskData taskConfig) public PlayerTask(TaskData taskConfig)
{ {
taskId = taskConfig.id; taskId = taskConfig.id;
assignedTime = DateTime.Now; assignedTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
expireTime = assignedTime.AddHours(taskConfig.durationHours); expireTime = DateTimeOffset.UtcNow.AddHours(taskConfig.durationHours).ToUnixTimeSeconds();
Debug.Log($"<color=red>" +
$"任务获取时间=={assignedTime}" +
$"任务结束时间=={expireTime}" +
$"</color>");
status = TaskStatus.Active; status = TaskStatus.Active;
progress = 0; progress = 0;
} }
// 从服务器响应数据创建玩家任务 // 从服务器响应数据创建玩家任务
public PlayerTask(PlayerTaskResponse response) public PlayerTask(PlayerTaskResponse response)
{ {
taskId = response.taskId; taskId = response.taskId;
assignedTime = new DateTime(response.assignedTime); assignedTime = response.assignedTime;
expireTime = new DateTime(response.expireTime); expireTime = response.expireTime;
Debug.Log($"<color=red>" +
$"任务获取时间=={assignedTime}" +
$"任务结束时间=={expireTime}" +
$"</color>");
status = (TaskStatus)response.status; status = (TaskStatus)response.status;
progress = response.progress; progress = response.progress;
} }
@@ -98,8 +107,8 @@ namespace TcgEngine
{ {
PlayerTaskResponse response = new PlayerTaskResponse(); PlayerTaskResponse response = new PlayerTaskResponse();
response.taskId = taskId; response.taskId = taskId;
response.assignedTime = assignedTime.Ticks; response.assignedTime = assignedTime;
response.expireTime = expireTime.Ticks; response.expireTime = expireTime;
response.status = (int)status; response.status = (int)status;
response.progress = progress; response.progress = progress;
return response; return response;

View File

@@ -136,7 +136,8 @@ namespace TcgEngine.Gameplay
// 从服务器API获取任务配置 // 从服务器API获取任务配置
string url = ApiClient.ServerURL + "/api/tasks"; string url = ApiClient.ServerURL + "/api/tasks";
WebResponse res = await ApiClient.Get().SendGetRequest(url); WebResponse res = await ApiClient.Get().SendGetRequest(url);
Debug.LogError("从服务器API获取任务配置" + res.data); Debug.LogError("从服务器API获取任务配置" + res.data + res.status);
Debug.LogError(res.success);
if (res.success) if (res.success)
{ {
// 解析任务配置数据 // 解析任务配置数据

View File

@@ -22,6 +22,10 @@ namespace TcgEngine.UI
public AvatarUI avatar; public AvatarUI avatar;
public GameObject loader; public GameObject loader;
[Header("xp")]
public Text level_text;
public Slider level_slider;
[Header("UI")] [Header("UI")]
public Text version_text; public Text version_text;
public DeckSelector deck_selector; public DeckSelector deck_selector;
@@ -51,6 +55,9 @@ namespace TcgEngine.UI
version_text.text = "Version " + Application.version; version_text.text = "Version " + Application.version;
deck_selector.onChange += OnChangeDeck; deck_selector.onChange += OnChangeDeck;
level_text.text = "";
level_slider.value = 0f;
if (Authenticator.Get().IsConnected()) if (Authenticator.Get().IsConnected())
AfterLogin(); AfterLogin();
else else
@@ -108,6 +115,10 @@ namespace TcgEngine.UI
username_txt.text = user.username; username_txt.text = user.username;
credits_txt.text = GameUI.FormatNumber(user.coins); credits_txt.text = GameUI.FormatNumber(user.coins);
// xp
level_text.text = user.GetLevel().ToString();
level_slider.value = user.GetLevelProgress();
AvatarData avatar = AvatarData.Get(user.avatar); AvatarData avatar = AvatarData.Get(user.avatar);
this.avatar.SetAvatar(avatar); this.avatar.SetAvatar(avatar);