diff --git a/Assets/TcgEngine/Scenes/Menu/Menu.unity b/Assets/TcgEngine/Scenes/Menu/Menu.unity index c3d50c4..aa5cd8c 100644 --- a/Assets/TcgEngine/Scenes/Menu/Menu.unity +++ b/Assets/TcgEngine/Scenes/Menu/Menu.unity @@ -643,7 +643,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 0 - highlight: {fileID: 26631289} ui_panel: {fileID: 211963062} --- !u!114 &26631292 MonoBehaviour: @@ -846,7 +845,7 @@ RectTransform: - {fileID: 551187115} - {fileID: 117996127} m_Father: {fileID: 441085351} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -3193,11 +3192,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 48645345bd785ef499a05c7438938a2c, type: 3} m_Name: m_EditorClassIdentifier: - display_speed: 4 - activePlayerTasks: [] - activeTasks: [] - taskItem: {fileID: 2864833012982062633, guid: d96e5fdf80d69324fb05eb1887005d53, - type: 3} --- !u!225 &211963063 CanvasGroup: m_ObjectHideFlags: 0 @@ -4333,7 +4327,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 441085351} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -4442,7 +4436,7 @@ CanvasGroup: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 256520187} m_Enabled: 1 - m_Alpha: 0 + m_Alpha: 1 m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 @@ -4722,7 +4716,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 0 - highlight: {fileID: 1172104343} ui_panel: {fileID: 396921782448154707} --- !u!114 &302193140 MonoBehaviour: @@ -4961,7 +4954,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 0 - highlight: {fileID: 415552494} ui_panel: {fileID: 706214462} --- !u!114 &332490983 MonoBehaviour: @@ -5692,7 +5684,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: active: 0 - highlight: {fileID: 961574939} ui_panel: {fileID: 0} --- !u!114 &382424044 MonoBehaviour: @@ -6423,7 +6414,6 @@ RectTransform: m_Children: - {fileID: 1758318021} - {fileID: 1975599769} - - {fileID: 947751578} - {fileID: 256520188} - {fileID: 1032189403} - {fileID: 1548237787} @@ -6435,6 +6425,7 @@ RectTransform: - {fileID: 1235042727} - {fileID: 732915989} - {fileID: 1674082197} + - {fileID: 947751578} - {fileID: 252977714} m_Father: {fileID: 581826003} m_RootOrder: 0 @@ -8519,7 +8510,7 @@ RectTransform: - {fileID: 774281754} - {fileID: 1626650279} m_Father: {fileID: 441085351} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -9505,6 +9496,127 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 632685560} m_CullTransparentMesh: 1 +--- !u!1 &632859783 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 632859784} + - component: {fileID: 632859787} + - component: {fileID: 632859786} + - component: {fileID: 632859785} + m_Layer: 5 + m_Name: UIFrameHide + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &632859784 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 632859783} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 947751578} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 638, y: 330} + m_SizeDelta: {x: 67.25, y: 67.25} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &632859785 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 632859783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 632859786} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &632859786 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 632859783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 9e5964a13b17ccd4da6ba2a5d12e76df, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &632859787 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 632859783} + m_CullTransparentMesh: 1 --- !u!1 &634295247 GameObject: m_ObjectHideFlags: 0 @@ -9575,7 +9687,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 1 - highlight: {fileID: 1853380837} ui_panel: {fileID: 441085352} --- !u!114 &634295251 MonoBehaviour: @@ -11027,7 +11138,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: card_trade active: 0 - highlight: {fileID: 464235176} ui_panel: {fileID: 1727585007} --- !u!114 &696120577 MonoBehaviour: @@ -11885,7 +11995,7 @@ RectTransform: - {fileID: 1583195643} - {fileID: 1454910422} m_Father: {fileID: 441085351} - m_RootOrder: 12 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -12659,7 +12769,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: active: 0 - highlight: {fileID: 2036687082} ui_panel: {fileID: 0} --- !u!114 &800912211 MonoBehaviour: @@ -12891,7 +13000,7 @@ RectTransform: m_Children: - {fileID: 1804081854} m_Father: {fileID: 441085351} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -14549,7 +14658,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 1 - highlight: {fileID: 223775410} ui_panel: {fileID: 441085352} --- !u!114 &866212870 MonoBehaviour: @@ -16124,6 +16232,7 @@ GameObject: - component: {fileID: 947751580} - component: {fileID: 947751579} - component: {fileID: 947751581} + - component: {fileID: 947751582} m_Layer: 5 m_Name: UIFrame m_TagString: Untagged @@ -16147,13 +16256,14 @@ RectTransform: - {fileID: 1067657578} - {fileID: 1611943003454912998} - {fileID: 1940984898} + - {fileID: 632859784} m_Father: {fileID: 441085351} - m_RootOrder: 2 + m_RootOrder: 13 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 264, y: -50} - m_SizeDelta: {x: 498.84, y: 599.05} + m_AnchoredPosition: {x: 0, y: -13.26} + m_SizeDelta: {x: 1922, y: 1083.87} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &947751579 MonoBehaviour: @@ -16168,14 +16278,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.21698111, g: 0.21698111, b: 0.21698111, a: 0.6509804} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: f4af5b94249bfa345858bae82ee962d6, type: 3} + m_Sprite: {fileID: 0} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -16205,6 +16315,20 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 +--- !u!114 &947751582 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 947751577} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9379c33c33779f64a94d441f6a521411, type: 3} + m_Name: + m_EditorClassIdentifier: + display_speed: 4 + uiFrameHideButton: {fileID: 632859785} --- !u!1001 &955449648 PrefabInstance: m_ObjectHideFlags: 0 @@ -16620,7 +16744,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 1 - highlight: {fileID: 0} ui_panel: {fileID: 441085352} --- !u!1 &992410215 GameObject: @@ -17507,7 +17630,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 0 - highlight: {fileID: 0} ui_panel: {fileID: 3342894375174218278} --- !u!114 &1024204032 MonoBehaviour: @@ -17740,7 +17862,7 @@ RectTransform: - {fileID: 981468365} - {fileID: 84982552} m_Father: {fileID: 441085351} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -20721,7 +20843,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 441085351} - m_RootOrder: 11 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -21544,7 +21666,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 0 - highlight: {fileID: 0} ui_panel: {fileID: 441085352} --- !u!1 &1260943116 GameObject: @@ -24842,7 +24963,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 1 - highlight: {fileID: 1868187360} ui_panel: {fileID: 441085352} --- !u!114 &1457537703 MonoBehaviour: @@ -26099,7 +26219,7 @@ RectTransform: - {fileID: 1386167122} - {fileID: 1784353083} m_Father: {fileID: 441085351} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -28159,7 +28279,7 @@ RectTransform: - {fileID: 991838448} - {fileID: 463162916} m_Father: {fileID: 441085351} - m_RootOrder: 13 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0} @@ -29075,7 +29195,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: card_trade active: 1 - highlight: {fileID: 1282580389} ui_panel: {fileID: 999773574} --- !u!114 &1729026489 MonoBehaviour: @@ -29578,7 +29697,7 @@ RectTransform: - {fileID: 1389982889} - {fileID: 641602034} m_Father: {fileID: 441085351} - m_RootOrder: 9 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -30738,7 +30857,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1851249555} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 2085134346} + m_TargetAssemblyTypeName: TcgEngine.UI.MainMenu, Assembly-CSharp + m_MethodName: OnUiFrameShow + m_Mode: 2 + m_Arguments: + m_ObjectArgument: {fileID: 947751582} + m_ObjectArgumentAssemblyTypeName: TcgEngine.UI.UIPanel, Assembly-CSharp + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!114 &1851249555 MonoBehaviour: m_ObjectHideFlags: 0 @@ -31473,7 +31604,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 441085351} - m_RootOrder: 10 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -33689,7 +33820,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 0 - highlight: {fileID: 1584732046} ui_panel: {fileID: 4526323995250171126} --- !u!114 &2104852001 MonoBehaviour: @@ -34008,7 +34138,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: menu active: 1 - highlight: {fileID: 1404944004} ui_panel: {fileID: 441085352} --- !u!114 &2133752682 MonoBehaviour: @@ -59058,7 +59187,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: friend active: 0 - highlight: {fileID: 6543051624723145879} ui_panel: {fileID: 0} --- !u!114 &6543051624350387892 MonoBehaviour: @@ -59272,7 +59400,6 @@ MonoBehaviour: m_EditorClassIdentifier: group: friend active: 1 - highlight: {fileID: 6543051624962361186} ui_panel: {fileID: 0} --- !u!222 &6543051624391944404 CanvasRenderer: diff --git a/Assets/TcgEngine/Scripts/GameLogic/TaskManager.cs b/Assets/TcgEngine/Scripts/GameLogic/TaskManager.cs index 1ce0ff4..488bc9d 100644 --- a/Assets/TcgEngine/Scripts/GameLogic/TaskManager.cs +++ b/Assets/TcgEngine/Scripts/GameLogic/TaskManager.cs @@ -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("Tasks"); } - + var loginTask = allTasks.FirstOrDefault(t => t.isDailyTask && t.condition == TaskConditionType.LoginGame); if (loginTask != null) diff --git a/Assets/TcgEngine/Scripts/Menu/MainMenu.cs b/Assets/TcgEngine/Scripts/Menu/MainMenu.cs index bd05350..f04f03d 100644 --- a/Assets/TcgEngine/Scripts/Menu/MainMenu.cs +++ b/Assets/TcgEngine/Scripts/Menu/MainMenu.cs @@ -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(); diff --git a/Assets/TcgEngine/Scripts/Menu/StarterDeckPanel.cs b/Assets/TcgEngine/Scripts/Menu/StarterDeckPanel.cs index 7905c9a..a4a03a4 100644 --- a/Assets/TcgEngine/Scripts/Menu/StarterDeckPanel.cs +++ b/Assets/TcgEngine/Scripts/Menu/StarterDeckPanel.cs @@ -6,8 +6,8 @@ using UnityEngine.UI; namespace TcgEngine.UI { /// - /// Selection of your starter deck - /// Will only appear in the main menu when in API mode with a new account + /// 初始套牌选择 + /// 仅当处于 API 模式且使用新账号时,才会在主菜单中显示 /// public class StarterDeckPanel : UIPanel diff --git a/Assets/TcgEngine/Scripts/UI/TabButton.cs b/Assets/TcgEngine/Scripts/UI/TabButton.cs index efa4b28..153e213 100644 --- a/Assets/TcgEngine/Scripts/UI/TabButton.cs +++ b/Assets/TcgEngine/Scripts/UI/TabButton.cs @@ -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;