瀏覽代碼

1. 统一了背包添加逻辑,装备和普通道具统一。
2. 添加了各个面板之间的设计跳转问题。
已知问题:开宝箱开出来的装备,未能正确添加到背包。

lcn 3 月之前
父節點
當前提交
d64b02ea44

+ 137 - 9
Assets/Res/UI/HeroDetailPanel.prefab

@@ -597,7 +597,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &6882296595196744850
 RectTransform:
   m_ObjectHideFlags: 0
@@ -1044,7 +1044,7 @@ RectTransform:
   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: 176, y: -480}
+  m_AnchoredPosition: {x: 176, y: -532}
   m_SizeDelta: {x: 100, y: 100}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!1 &578317878836440111
@@ -7644,6 +7644,7 @@ GameObject:
   - component: {fileID: 623255991371403637}
   - component: {fileID: 1241343374939031043}
   - component: {fileID: 1900182250154511773}
+  - component: {fileID: 2511697509442057399}
   m_Layer: 0
   m_HasEditorInfo: 1
   m_Name: Button_Common_Equip
@@ -7719,6 +7720,50 @@ MonoBehaviour:
     packgJsonPath: /Art/UIAssets/TextrueJson/all.txt
     packgSpritePath: Assets/Res/UIAtlas/all.spriteatlasv2
     lasetJsonGUID: ace5466faa841bb7b9046587aae54d38
+--- !u!114 &2511697509442057399
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4116640840244103549}
+  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: 1900182250154511773}
+  m_OnClick:
+    m_PersistentCalls:
+      m_Calls: []
 --- !u!1 &4150640207593807359
 GameObject:
   m_ObjectHideFlags: 0
@@ -8442,7 +8487,7 @@ GameObject:
   - component: {fileID: 2875697944268458280}
   m_Layer: 0
   m_HasEditorInfo: 1
-  m_Name: Icon
+  m_Name: zyIcon
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
@@ -8464,7 +8509,7 @@ RectTransform:
   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: 0, y: 16}
+  m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 65, y: 70}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &4473099127099111067
@@ -12751,6 +12796,24 @@ MonoBehaviour:
     - gameObject: {fileID: 386705721927191908}
     - gameObject: {fileID: 3414719560540881468}
     - gameObject: {fileID: 6905440077724744462}
+  - key: btnSpecailEquip
+    gameObject: {fileID: 8534689456493960730}
+    isAssetBundle: 0
+    isList: 0
+    ListCollectorDatas:
+    - gameObject: {fileID: 2431497390631250942}
+    - gameObject: {fileID: 386705721927191908}
+    - gameObject: {fileID: 3414719560540881468}
+    - gameObject: {fileID: 6905440077724744462}
+  - key: btnCommonEquip
+    gameObject: {fileID: 2511697509442057399}
+    isAssetBundle: 0
+    isList: 0
+    ListCollectorDatas:
+    - gameObject: {fileID: 2431497390631250942}
+    - gameObject: {fileID: 386705721927191908}
+    - gameObject: {fileID: 3414719560540881468}
+    - gameObject: {fileID: 6905440077724744462}
   isAssetBundle: 1
 --- !u!225 &4187952801782332659
 CanvasGroup:
@@ -12780,7 +12843,7 @@ MonoBehaviour:
   isUpdate: 0
   currTime: 1
   GrpupInfos:
-  - Foldout: 1
+  - Foldout: 0
     isActive: 1
     animName: play
     isLoop: 0
@@ -14164,7 +14227,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &5411041259621187802
 RectTransform:
   m_ObjectHideFlags: 0
@@ -17715,6 +17778,7 @@ GameObject:
   - component: {fileID: 3194259057530332381}
   - component: {fileID: 2867636092260181629}
   - component: {fileID: 5460311739122094778}
+  - component: {fileID: 8534689456493960730}
   m_Layer: 0
   m_HasEditorInfo: 1
   m_Name: Button_Specail_Equip
@@ -17804,6 +17868,50 @@ MonoBehaviour:
     packgJsonPath: /Art/UIAssets/TextrueJson/all.txt
     packgSpritePath: Assets/Res/UIAtlas/all.spriteatlasv2
     lasetJsonGUID: ace5466faa841bb7b9046587aae54d38
+--- !u!114 &8534689456493960730
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8262466841460713280}
+  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: 5460311739122094778}
+  m_OnClick:
+    m_PersistentCalls:
+      m_Calls: []
 --- !u!1 &8277847055366427664
 GameObject:
   m_ObjectHideFlags: 0
@@ -19934,6 +20042,10 @@ PrefabInstance:
       propertyPath: m_Name
       value: SkillUIComponent
       objectReference: {fileID: 0}
+    - target: {fileID: 3724598441491386566, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
+      propertyPath: m_IsActive
+      value: 0
+      objectReference: {fileID: 0}
     - target: {fileID: 5231644514269099707, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchorMax.y
       value: 1
@@ -19942,13 +20054,17 @@ PrefabInstance:
       propertyPath: m_AnchorMin.y
       value: 1
       objectReference: {fileID: 0}
+    - target: {fileID: 5231644514269099707, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 31
+      objectReference: {fileID: 0}
     - target: {fileID: 5231644514269099707, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.x
       value: 344
       objectReference: {fileID: 0}
     - target: {fileID: 5231644514269099707, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.y
-      value: -55
+      value: -82
       objectReference: {fileID: 0}
     - target: {fileID: 8233403908056166009, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchorMax.y
@@ -19958,13 +20074,17 @@ PrefabInstance:
       propertyPath: m_AnchorMin.y
       value: 1
       objectReference: {fileID: 0}
+    - target: {fileID: 8233403908056166009, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 31
+      objectReference: {fileID: 0}
     - target: {fileID: 8233403908056166009, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.x
       value: 344
       objectReference: {fileID: 0}
     - target: {fileID: 8233403908056166009, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.y
-      value: -82.5
+      value: -123
       objectReference: {fileID: 0}
     - target: {fileID: 8439587507723242819, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchorMax.y
@@ -19974,6 +20094,10 @@ PrefabInstance:
       propertyPath: m_AnchorMin.y
       value: 1
       objectReference: {fileID: 0}
+    - target: {fileID: 8439587507723242819, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 31
+      objectReference: {fileID: 0}
     - target: {fileID: 8439587507723242819, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.x
       value: 344
@@ -20070,13 +20194,17 @@ PrefabInstance:
       propertyPath: m_AnchorMin.y
       value: 1
       objectReference: {fileID: 0}
+    - target: {fileID: 8870045557280260565, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 31
+      objectReference: {fileID: 0}
     - target: {fileID: 8870045557280260565, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.x
       value: 344
       objectReference: {fileID: 0}
     - target: {fileID: 8870045557280260565, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.y
-      value: -27.5
+      value: -41
       objectReference: {fileID: 0}
     m_RemovedComponents: []
     m_RemovedGameObjects: []

+ 1 - 19
Assets/Res/UI/ProfessionEquipmentPanel.prefab

@@ -3729,8 +3729,6 @@ SkinnedMeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 3
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
@@ -5038,8 +5036,6 @@ MeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 2
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
@@ -5629,8 +5625,6 @@ MeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 2
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
@@ -6052,8 +6046,6 @@ MeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 2
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
@@ -8234,8 +8226,6 @@ MeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 2
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
@@ -9015,7 +9005,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &6764302726913215062
 RectTransform:
   m_ObjectHideFlags: 0
@@ -9569,8 +9559,6 @@ MeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 2
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
@@ -9767,8 +9755,6 @@ MeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 2
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
@@ -10563,8 +10549,6 @@ MeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 2
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
@@ -11228,8 +11212,6 @@ SkinnedMeshRenderer:
   m_ReflectionProbeUsage: 1
   m_RayTracingMode: 3
   m_RayTraceProcedural: 0
-  m_virtualGeometry: 0
-  m_virtualGeometryShadow: 0
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:

+ 4 - 4
Assets/Res/UI/SpecificProfessionEquipmentPanel.prefab

@@ -730,7 +730,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &3123478514941861925
 RectTransform:
   m_ObjectHideFlags: 0
@@ -1160,7 +1160,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &833831717708301688
 RectTransform:
   m_ObjectHideFlags: 0
@@ -2383,7 +2383,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &3870529561131869925
 RectTransform:
   m_ObjectHideFlags: 0
@@ -3586,7 +3586,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &267772551406663904
 RectTransform:
   m_ObjectHideFlags: 0

+ 1 - 0
Assets/Scripts/Core/Event/Event/CustomEventType.cs

@@ -71,5 +71,6 @@ namespace Fort23.Core
       /// 玩家使用技能
       /// </summary>
       PlayerUseSkill,
+      
     }
 }

+ 57 - 26
Assets/Scripts/GameLogic/Bag/BagController.cs

@@ -134,26 +134,42 @@ namespace GameLogic.Bag
             string guidStr = string.IsNullOrEmpty(guid) ? itemId.ToString() : guid;
             
             ItemInfo item = GetItemInfo(itemId, guidStr);
-            return AddItem(item, count);
+            return AddItemCount(item, count);
         }
 
+        /// <summary>
+        /// 添加道具,装备和普通道具都可以
+        /// </summary>
+        /// <param name="itemInfos"></param>
         public void AddItem(List<ItemInfo> itemInfos)
         {
             for (int i = 0; i < itemInfos.Count; i++)
             {
-                ItemInfo itemInfo = itemInfos[i];
-                LogTool.Log("获得了道具"+itemInfo.itemID);
-                AddItem(itemInfo, itemInfo.count.Value);
+                
+                ItemInfo item = itemInfos[i];
+                LogTool.Log("获得了道具"+item.itemID);
+                AddItem(item);
+                // //掉落的数量
+                // long count = itemInfo.count.Value;
+                // ItemInfo item = GetItemInfo(itemInfo);
+                //
+                // if (item.IsEquipItem())
+                // {
+                //     PlayerManager.Instance.eqController.AddEquipment(item);
+                // }
+                //
+                
+                // AddItemCount(item, count);
             }
         }
 
         /// <summary>
-        /// 添加道具,最后都走这里
+        /// 添加道具数量,最后都走这里
         /// </summary>
         /// <param name="item"></param>
         /// <param name="count"></param>
         /// <returns></returns>
-        private bool AddItem(ItemInfo item, long count)
+        private bool AddItemCount(ItemInfo item, long count)
         {
             if (item.config.ID <= 0 && string.IsNullOrEmpty(item.guid))
             {
@@ -188,20 +204,21 @@ namespace GameLogic.Bag
         // }
 
         /// <summary>
-        /// 添加装备道具
+        /// 添加道具,装备和普通道具都可以
         /// </summary>
         /// <param name="item"></param>
-        public void AddEquipmentItem(ItemInfo item)
+        public void AddItem(ItemInfo item)
         {
             //掉落的数量
             long count = item.count.Value;
-// LogTool.Log("掉落装备的GUID=" + item.guid);
-            // AddEqToDic(eqItemInfo);
-            ItemInfo eqItemInfo = GetItemInfo(item);
-            PlayerManager.Instance.eqController.AddEquipment(eqItemInfo);
+            ItemInfo itemInfo = GetItemInfo(item);
+            
+            if (itemInfo.IsEquipItem())
+            {
+                PlayerManager.Instance.eqController.AddEquipment(itemInfo);    
+            }
 
-            // m_bagEqList.Add(eqItemInfo);
-            AddItem(eqItemInfo, count);
+            AddItemCount(itemInfo, count);
         }
 
         /// <summary>
@@ -232,12 +249,33 @@ namespace GameLogic.Bag
             itemInfo.count.Value -= itemInfo.count.Value;
             AccountFileInfo.Instance.SaveItemData(itemInfo, saveNow);
         }
+        
+        /// <summary>
+        /// 获取道具信息
+        /// 不传guid,默认itemId就是guid
+        /// </summary>
+        /// <param name="itemId"></param>
+        /// <param name="guid"></param>
+        /// <returns></returns>
+        // public ItemInfo GetItemInfo(ItemInfo itemInfo)
+        // {
+        //     string guidStr = string.IsNullOrEmpty(itemInfo.guid) ? itemInfo.itemID.ToString() : itemInfo.guid;
+        //
+        //     if (m_allBagDic.TryGetValue(guidStr, out ItemInfo item))
+        //     {
+        //         return item;
+        //     }
+        //
+        //     m_allBagDic.Add(itemInfo.guid, itemInfo);
+        //
+        //     return itemInfo;
+        // }
 
         /// <summary>
         /// 一般是掉了(随机)一个东西(ItemInfo),然后来背包找,是否之前掉过一样的
-        /// 一般用于有guid的item
-        /// 比如掉了一个装备,装备有guid(组装的)
-        /// 后续有其他类似装备这种,动态组织出来的有guid的物品,也可以走这里。宝石,词条等。
+        /// 之前有,就把有的返回回去,加数量
+        /// 之前无,就返回这个新东西
+        /// /// 重要:加入背包管理都是通过这个方法(后续看是否优)
         /// </summary>
         /// <param name="itemInfo"></param>
         /// <returns></returns>
@@ -268,15 +306,6 @@ namespace GameLogic.Bag
         /// <returns></returns>
         public ItemInfo GetItemInfo(int itemId, string guid = "")
         {
-            // for (int i = 0; i < m_bagList.Count; i++)
-            // {
-            //     ItemInfo item = m_bagList[i];
-            //     if (item.itemID == itemId)
-            //     {
-            //         return item;
-            //     }
-            // }
-
             string guidStr = string.IsNullOrEmpty(guid) ? itemId.ToString() : guid;
 
             if (m_allBagDic.TryGetValue(guidStr, out ItemInfo item))
@@ -294,6 +323,8 @@ namespace GameLogic.Bag
             return newItem;
         }
         
+       
+        
 
         /// <summary>
         /// 扣除道具,最后都这里

+ 1 - 1
Assets/Scripts/GameLogic/Bag/ItemInfo.cs

@@ -55,7 +55,7 @@ namespace GameLogic.Bag
         }
 
         /// <summary>
-        /// 是否是装备的Item
+        /// 是一个装备吗
         /// </summary>
         /// <returns></returns>
         public bool IsEquipItem()

+ 12 - 0
Assets/Scripts/GameLogic/Combat/CombatEvent/HeroEquipEventData.cs

@@ -0,0 +1,12 @@
+using Core.Utility.Event;
+
+namespace Common.Utility.CombatEvent
+{
+    public class HeroEquipEventData : EventDataBasic<HeroEquipEventData>
+    {
+        /// <summary>
+        /// 哪个职业的英雄装备有变化
+        /// </summary>
+        public int zy;
+    }
+}

+ 3 - 0
Assets/Scripts/GameLogic/Combat/CombatEvent/HeroEquipEventData.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 937830a97524410fa9ed03b483830b88
+timeCreated: 1735469456

+ 9 - 4
Assets/Scripts/GameLogic/Hero/HeroInfo.cs

@@ -48,15 +48,20 @@ namespace GameLogic.Hero
 
         public HeroInfo()
         {
-            EventManager.Instance.AddEventListener(CustomEventType.HeroPowerUp, OnHeroPowerUp);
+            EventManager.Instance.AddEventListener(CustomEventType.HeroEquip, OnHeroEquip);
         }
 
-        private void OnHeroPowerUp(IEventData e)
+        private void OnHeroEquip(IEventData e)
         {
-            HeroPowerUpEventData data = e as HeroPowerUpEventData;
-            if (data.upType == HeroUpType.BasicEquip)
+            HeroEquipEventData data = e as HeroEquipEventData;
+            if (data.zy == modelConfig.profession)
             {
                 CalAttribute();
+                HeroPowerUpEventData eventData = HeroPowerUpEventData.Create();
+                eventData.heroModelID = modelID;
+                eventData.isSkillUp = false;
+                eventData.upType = HeroUpType.BasicEquip;
+                EventManager.Instance.Dispatch(CustomEventType.HeroPowerUp, eventData);
             }
         }
 

+ 2 - 4
Assets/Scripts/GameLogic/Player/DropManager.cs

@@ -52,9 +52,6 @@ namespace GameLogic.Player
                 int.Parse(eqDropData[1]),
                 int.Parse(eqDropData[2]));
 
-            if (eqItemInfo != null)
-                BagController.Instance.AddEquipmentItem(eqItemInfo);
-
             return eqItemInfo;
         }
 
@@ -96,7 +93,8 @@ namespace GameLogic.Player
             {
                 equipmentList.Add(itemInfo);
             }
-
+            
+            BagController.Instance.AddItem(equipmentList);
             return equipmentList;
         }
 

+ 28 - 6
Assets/Scripts/GameUI/UI/Hero/HeroDetailPanel.cs

@@ -41,6 +41,25 @@ namespace Fort23.Mono
             btnSkill.onClick.AddListener(OnClickSkill);
             btnPrev.onClick.AddListener(OnclickPrevHero);
             btnNext.onClick.AddListener(OnclickNextHero);
+            
+            btnSpecailEquip.onClick.AddListener(delegate
+            {
+                TipMessagePanel.OpenTipMessagePanel("专属装备(敬请期待)",
+                    new Vector2(btnSpecailEquip.transform.position.x, btnSpecailEquip.transform.position.y + 0.5f));
+            });
+            
+            btnCommonEquip.onClick.AddListener(OnclickCommonEquip);
+        }
+
+        private void OnclickCommonEquip()
+        {
+            // throw new System.NotImplementedException();
+            ModelPos.gameObject.SetActive(false);
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(heroInfo.modelConfig.profession, delegate
+            {
+                ModelPos.gameObject.SetActive(true);
+                modelAnimComponent.Play(modelIdleClip);
+            });
         }
 
         private void OnclickPrevHero()
@@ -354,6 +373,8 @@ namespace Fort23.Mono
         public UIPanelName sourcePanel;
         
         private GameObjectPool modelObj;
+        private AnimancerComponent modelAnimComponent;
+        private TransitionAsset modelIdleClip;
         HeroPowerUpPre upPre;
         public async void InitHeroDetailPanel(WidgetHero heroWidget, UIPanelName sourcePanel = UIPanelName.None)
         {
@@ -371,6 +392,7 @@ namespace Fort23.Mono
             btnPrev.gameObject.SetActive(IsShowArrow(false));
 
             iconZhiYe.icon_name = heroInfo.GetZyIconName();
+            iconCommonEquip.icon_name = heroInfo.GetZyIconName();
             heroName.text = LanguageManager.Instance.Text(heroInfo.modelConfig.name);
             // LayoutRebuilder.MarkLayoutForRebuild(StarsLayout.transform.GetComponent<RectTransform>());
             // StarsLayout.gameObject.SetActive(true);
@@ -398,18 +420,18 @@ namespace Fort23.Mono
                     pool.own.transform.localPosition = new Vector3(0, 0.2f, 0);
                     pool.own.transform.localScale = Vector3.one;
 
-                    AnimancerComponent animancerComponent = pool.own.GetComponent<AnimancerComponent>();
+                    modelAnimComponent = pool.own.GetComponent<AnimancerComponent>();
                     
-                    int max = animancerComponent.Transitions.Library.Count;
+                    int max = modelAnimComponent.Transitions.Library.Count;
                     for (int i = 0; i < max; i++)
                     {
-                        if (animancerComponent.Transitions.Library.TryGetTransition(i,
+                        if (modelAnimComponent.Transitions.Library.TryGetTransition(i,
                                 out TransitionModifierGroup transition))
                         {
-                            TransitionAsset clipTransition2 = transition.Transition as TransitionAsset;
-                            if (clipTransition2 != null && clipTransition2.name == "idle")
+                            modelIdleClip = transition.Transition as TransitionAsset;
+                            if (modelIdleClip != null && modelIdleClip.name == "idle")
                             {
-                                animancerComponent.Play(clipTransition2);
+                                modelAnimComponent.Play(modelIdleClip);
                                 break;
                             }
                         }

+ 22 - 0
Assets/Scripts/GameUI/UI/Hero/HeroDetailPanelData.cs

@@ -362,6 +362,28 @@ namespace Fort23.Mono
 	      return _skillUI;
 	     }
 	   }
+	  private Button _btnSpecailEquip;
+	  public Button btnSpecailEquip
+	   {
+	   get{
+	      if (_btnSpecailEquip == null)
+	       {
+	         _btnSpecailEquip  = GetUIUnit<Button>("btnSpecailEquip"); 
+	       }
+	      return _btnSpecailEquip;
+	     }
+	   }
+	  private Button _btnCommonEquip;
+	  public Button btnCommonEquip
+	   {
+	   get{
+	      if (_btnCommonEquip == null)
+	       {
+	         _btnCommonEquip  = GetUIUnit<Button>("btnCommonEquip"); 
+	       }
+	      return _btnCommonEquip;
+	     }
+	   }
 	  #endregion 自定义数据结束 
 	 public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
 	{

+ 11 - 0
Assets/Scripts/GameUI/UI/Hero/HeroUITools.cs

@@ -178,6 +178,17 @@ namespace Fort23.Mono
             }
         }
         
+        /// <summary>
+        /// 打开对应职业的装备面板
+        /// </summary>
+        /// <param name="zy">1战士;2法师;3牧师;4游侠</param>
+        public static async void OpenSpecificProfessionEquipmentPanel(int zy, Action action = null)
+        {
+            SpecificProfessionEquipmentPanel specificProfessionEquipmentPanel 
+                = await UIManager.Instance.LoadAndOpenPanel<SpecificProfessionEquipmentPanel>(null);
+            specificProfessionEquipmentPanel.InitPanel(zy, action);
+        }
+        
         /// <summary>
         /// 修改指定 GameObject 和其所有子对象的 Layer
         /// </summary>

+ 26 - 10
Assets/Scripts/GameUI/UI/Hero/ProfessionEquipmentPanel.cs

@@ -1,4 +1,6 @@
 using System.Collections.Generic;
+using Common.Utility.CombatEvent;
+using Fort23.Core;
 using Fort23.UTool;
 using GameLogic.Bag;
 using UnityEngine;
@@ -13,7 +15,20 @@ namespace Fort23.Mono
         }
         protected override void AddEvent()
         {
+            EventManager.Instance.AddEventListener(CustomEventType.HeroEquip, OnHeroEquip);
         }
+
+        private void OnHeroEquip(IEventData e)
+        {
+            // ProfessionEquipmentPanel professionEquipmentPanel = UIManager.Instance.GetComponent<ProfessionEquipmentPanel>();
+            
+            //现在是全更新的,后面可以优化成只更新对应职业的装备栏,现在无法这样做的原因是,池子回收了全部装备
+            HeroEquipEventData data = e as HeroEquipEventData;
+            
+                
+            UpdateAllEq();
+        }
+
         protected override void DelEvent()
         {
         }
@@ -35,34 +50,35 @@ namespace Fort23.Mono
 
         private async void OnclickZS()
         {
-            OpenSpecificProfessionEquipmentPanel(1);
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(1);
+            
         }
         
         private async void OnclickFS()
         {
-            OpenSpecificProfessionEquipmentPanel(2);
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(2);
         }
         
         private async void OnclickMS()
         {
-            OpenSpecificProfessionEquipmentPanel(3);
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(3);
         }
         
         private async void OnclickYX()
         {
-            OpenSpecificProfessionEquipmentPanel(4);
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(4);
         }
 
         /// <summary>
         /// 打开对应职业的装备面板
         /// </summary>
         /// <param name="zy">1战士;2法师;3牧师;4游侠</param>
-        private async void OpenSpecificProfessionEquipmentPanel(int zy)
-        {
-            SpecificProfessionEquipmentPanel specificProfessionEquipmentPanel 
-                = await UIManager.Instance.LoadAndOpenPanel<SpecificProfessionEquipmentPanel>(null);
-            specificProfessionEquipmentPanel.InitPanel(zy);
-        }
+        // private async void OpenSpecificProfessionEquipmentPanel(int zy)
+        // {
+        //     SpecificProfessionEquipmentPanel specificProfessionEquipmentPanel 
+        //         = await UIManager.Instance.LoadAndOpenPanel<SpecificProfessionEquipmentPanel>(null);
+        //     specificProfessionEquipmentPanel.InitPanel(zy);
+        // }
 
         private void OnclickBack()
         {

+ 72 - 14
Assets/Scripts/GameUI/UI/Hero/SpecificProfessionEquipmentPanel.cs

@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using Common.Utility.CombatEvent;
 using Core.Language;
@@ -24,6 +25,51 @@ namespace Fort23.Mono
         {
             btnBack.onClick.AddListener(OnclickClose);
             btnOnce.onClick.AddListener(OnclickOnce);
+            
+            btnZs.onClick.AddListener(OnclickZS);
+            btnFs.onClick.AddListener(OnclickFS);
+            btnMs.onClick.AddListener(OnclickMS);
+            btnYx.onClick.AddListener(OnclickYX);
+            
+        }
+
+        private void OnclickZS()
+        {
+            if (curZy == 1)
+            {
+                return;
+            }
+            
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(1);
+        }
+
+        private void OnclickFS()
+        {
+            if (curZy == 2)
+            {
+                return;
+            }
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(2);
+        }
+
+        private void OnclickMS()
+        {
+            if (curZy == 3)
+            {
+                return;
+            }
+            
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(3);
+        }
+
+        private void OnclickYX()
+        {
+            if (curZy == 4)
+            {
+                return;
+            }
+            
+            HeroUITools.OpenSpecificProfessionEquipmentPanel(4);
         }
 
         private bool isClickOnce = false;
@@ -36,38 +82,50 @@ namespace Fort23.Mono
             isClickOnce = PlayerManager.Instance.eqController.QuickEquip(curZy);
             if (isClickOnce)
             {
+                
+                SendWearEvent();
+                
                 UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq2");
                 HeroUITools.UpdateZyEqIcon(curZy, eqs);
             }
         }
 
+        private void SendWearEvent()
+        {
+            // ProfessionEquipmentPanel professionEquipmentPanel = UIManager.Instance.GetComponent<ProfessionEquipmentPanel>();
+            //     
+            // professionEquipmentPanel.UpdateAllEq();
+                
+            HeroEquipEventData data = new HeroEquipEventData();
+
+            data.zy = curZy;
+                
+            // EventManager.Instance.Dispatch(CustomEventType.HeroPowerUp, data);
+            EventManager.Instance.Dispatch(CustomEventType.HeroEquip, data);
+        }
+
         private async void OnclickClose()
         {
             UIManager.Instance.HideUIUIPanel(this);
-            UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq2");
+            closeAction?.Invoke();
+            UIManager.Instance.DormancyAllGComponent<WidgetItem>(spoolName);
             if (isClickOnce)
             {
                 UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq");
-                ProfessionEquipmentPanel professionEquipmentPanel = UIManager.Instance.GetComponent<ProfessionEquipmentPanel>();
-                
-                // ProfessionEquipmentPanel professionEquipmentPanel = await UIManager.Instance.LoadAndOpenPanel<ProfessionEquipmentPanel>(null);
-                // professionEquipmentPanel.UpdateZyEqs(curZy);
-                professionEquipmentPanel.UpdateAllEq();
-                
-                HeroPowerUpEventData data = new HeroPowerUpEventData();
-
-                data.upType = HeroUpType.BasicEquip;
-                
-                EventManager.Instance.Dispatch(CustomEventType.HeroPowerUp, data);
             }
         }
 
-        public void InitPanel(int zy)
+        private string spoolName = "eq2";
+        private Action closeAction;
+        
+        public void InitPanel(int zy, Action action = null)
         {
             isClickOnce = false;
             curZy = zy;
+            closeAction = action;
             SetZyInfo();
-            HeroUITools.UpdateZyEqIcon(zy, eqs, poolName:"eq2");
+            UIManager.Instance.DormancyAllGComponent<WidgetItem>(spoolName);
+            HeroUITools.UpdateZyEqIcon(zy, eqs, poolName : spoolName);
         }
 
         private void SetZyInfo()

+ 5 - 5
美术/工具/imgui.ini

@@ -10,27 +10,27 @@ Collapsed=0
 
 [Window][Tool]
 Pos=400,0
-Size=715,100
+Size=709,100
 Collapsed=0
 
 [Window][unity_art]
-Pos=1115,0
+Pos=1109,0
 Size=400,720
 Collapsed=0
 
 [Window][console]
 Pos=400,520
-Size=715,70
+Size=709,70
 Collapsed=0
 
 [Window][控制台]
 Pos=400,590
-Size=715,130
+Size=709,130
 Collapsed=0
 
 [Window][scence]
 Pos=400,100
-Size=715,420
+Size=709,420
 Collapsed=0
 
 [Docking][Data]