ソースを参照

Merge branch 'master' of http://192.168.123.2:3000/ck/XiuXianGame

# Conflicts:
#	Excel2Json/Excel/EventConfig.xlsx   resolved by master version
邹舸 3 週間 前
コミット
ea7904429b

+ 8 - 0
Assets/Res/UI/RewardsPanel.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: By8esi34UXwtvto16eeC5UKHWPuP2p1++LnkyFe0UpZwpwvc/LMgqHz24eaR
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Assets/Res/UI/RewardsPanel.prefab → Assets/Res/UI/RewardsPanel/RewardsPanel.prefab


+ 0 - 0
Assets/Res/UI/RewardsPanel.prefab.meta → Assets/Res/UI/RewardsPanel/RewardsPanel.prefab.meta


+ 0 - 53
Assets/Res/UI/WidgetItem.prefab

@@ -1430,7 +1430,6 @@ GameObject:
   - component: {fileID: 1515036893769208877}
   - component: {fileID: 5132790119407906693}
   - component: {fileID: 1991110530740727775}
-  - component: {fileID: 853300728457438981}
   m_Layer: 0
   m_HasEditorInfo: 1
   m_Name: WidgetItem
@@ -1597,58 +1596,6 @@ MonoBehaviour:
   m_OnClick:
     m_PersistentCalls:
       m_Calls: []
---- !u!114 &853300728457438981
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 8408847998961895963}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 06d86505a6dfd2f4dad16b669a8b3eb5, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  bgColors:
-  - {r: 0.096999995, g: 0.096999995, b: 0.096999995, a: 1}
-  - {r: 0.11372549, g: 0.7529412, b: 0.3372549, a: 1}
-  - {r: 0.11372549, g: 0.7529412, b: 0.3372549, a: 1}
-  - {r: 0, g: 0.65882355, b: 1, a: 1}
-  - {r: 0.69803923, g: 0.3764706, b: 0.99215686, a: 1}
-  - {r: 1, g: 0.7882353, b: 0, a: 1}
-  - {r: 0.8745098, g: 0.18431373, b: 0.21960784, a: 1}
-  cornerColors:
-  - {r: 0, g: 0, b: 0, a: 0}
-  - {r: 0.20392157, g: 0.8509804, b: 0.20392157, a: 1}
-  - {r: 0.20392157, g: 0.8509804, b: 0.20392157, a: 1}
-  - {r: 0.17254902, g: 0.74509805, b: 1, a: 1}
-  - {r: 0.78431374, g: 0.5019608, b: 0.99607843, a: 1}
-  - {r: 1, g: 0.87058824, b: 0, a: 1}
-  - {r: 0.99215686, g: 0.2784314, b: 0.29411766, a: 1}
-  lightColors:
-  - {r: 0.046, g: 0.046, b: 0.046, a: 1}
-  - {r: 0.6509804, g: 0.9607843, b: 0.31764707, a: 1}
-  - {r: 0.6509804, g: 0.9607843, b: 0.31764707, a: 1}
-  - {r: 0.20784314, g: 0.9843137, b: 1, a: 1}
-  - {r: 1, g: 0.654902, b: 1, a: 1}
-  - {r: 0.99607843, g: 0.99215686, b: 0.30588236, a: 1}
-  - {r: 1, g: 0.5254902, b: 0.5803922, a: 1}
-  borderColors:
-  - {r: 0.046, g: 0.046, b: 0.046, a: 1}
-  - {r: 0.09411765, g: 0.09411765, b: 0.20392157, a: 1}
-  - {r: 0.09411765, g: 0.09411765, b: 0.20392157, a: 1}
-  - {r: 0.09411765, g: 0.09411765, b: 0.20392157, a: 1}
-  - {r: 0.09411765, g: 0.09411765, b: 0.20392157, a: 1}
-  - {r: 0.03529412, g: 0.14901961, b: 0.37254903, a: 1}
-  - {r: 0.03529412, g: 0.14901961, b: 0.37254903, a: 1}
-  glowColors:
-  - {r: 0, g: 0, b: 0, a: 1}
-  - {r: 0.7529412, g: 1, b: 0.31764707, a: 1}
-  - {r: 0.7529412, g: 1, b: 0.31764707, a: 1}
-  - {r: 0.03137255, g: 0.9372549, b: 1, a: 1}
-  - {r: 0.7254902, g: 0.5882353, b: 1, a: 1}
-  - {r: 0.9529412, g: 1, b: 0.19215687, a: 1}
-  - {r: 1, g: 0.6156863, b: 0.6431373, a: 1}
 --- !u!1 &8582175795744355875
 GameObject:
   m_ObjectHideFlags: 0

+ 42 - 40
Assets/Scripts/GameData/ExcelConfig/EventConditionConfig.cs

@@ -1,86 +1,88 @@
-// Auto Generated Code By excel2json
-// Generate From Excel\EventConfig.xlsx. SheetName: EventConditionConfig
+// Auto Generated Code By excel2json
+// Generate From Excel\EventConfig.xlsx. SheetName: EventConditionConfig
 
-using System;
+using System;
 using Fort23.GameData;
-
+
 namespace Excel2Json
-{
-	[Config(prefab = "EventConditionConfig.json")]
-	public partial class EventConditionConfigHolder : ConfigHolder<EventConditionConfig>
	{
-	}
-
-
-	[Serializable]
-	public struct EventConditionConfig : IConfig
	{
-		public int GetID() {return ID;} 
+{
+	[Config(prefab = "EventConditionConfig.json")]
+	public partial class EventConditionConfigHolder : ConfigHolder<EventConditionConfig>
+	{
+	}
+
+
+	[Serializable]
+	public struct EventConditionConfig : IConfig
+	{
+		public int GetID() {return ID;} 
 		/// <summary>
 		///条件ID
 		/// </summary>
 public int ID;
-
-
+
+
 		/// <summary>
 		///文本语言表ID
 		/// </summary>
 public int[] LanID;
-
-
+
+
 		/// <summary>
 		///条件判断类型
 		/// </summary>
 public int ConditionType;
-
-
+
+
 		/// <summary>
 		///条件判断数值
 		/// </summary>
 public int[] ConditionPara;
-
-
+
+
 		/// <summary>
 		///事件类型 1=提供选项 2=进入战斗 3=获得奖励
 		/// </summary>
 public int optionType;
-
-
+
+
 		/// <summary>
 		///事件常量1 1=事件IDs 2=战斗ID 3=
 		/// </summary>
 public int[] optionPara1;
-
-
+
+
 		/// <summary>
 		///事件常量2 1=事件文本 2= 3=
 		/// </summary>
-public int optionPara2;
-
-
+public int[] optionPara2;
+
+
 		/// <summary>
 		///事件结局奖励
 		/// </summary>
 public int[] PrizeIDs;
-
-
+
+
 		/// <summary>
 		///事件结局奖励数量
 		/// </summary>
 public int[] PrizeNums;
-
-
+
+
 		/// <summary>
 		///事件结局后提供的选项
 		/// </summary>
 public int[] ResultOptions;
-
-
+
+
 		/// <summary>
 		///事件结局文本
 		/// </summary>
 public int[] ResultLanID;
-
-
-	}
-
-}
-// End of Auto Generated Code
+
+
+	}
+
+}
+// End of Auto Generated Code

+ 21 - 5
Assets/Scripts/GameLogic/EventManager/DialogueManager.cs

@@ -6,6 +6,7 @@ using Excel2Json;
 using Fort23.Core;
 using Fort23.Mono;
 using Fort23.UTool;
+using GameLogic.Bag;
 using UnityEngine;
 using Utility;
 
@@ -15,9 +16,9 @@ public class DialogueManager : Singleton<DialogueManager>
 
     private Action onDialogueComplete;
 
-    DialogueMono dialogue;
+    IDialogueMono dialogue;
 
-    public void CustomInit(DialogueMono dialogueMono)
+    public void CustomInit(IDialogueMono dialogueMono)
     {
         dialogue = dialogueMono;
     }
@@ -79,24 +80,39 @@ public class DialogueManager : Singleton<DialogueManager>
     /// <summary>
     /// 结束对话 
     /// </summary>
-    private void EndDialogue1()
+    private async void EndDialogue1()
     {
         EventConditionConfig dialogueConfig = ConfigComponent.Instance.Get<EventConditionConfig>(currentDialogueID);
         switch (dialogueConfig.optionType)
         {
-            //选项在这里不处理 在ui层处理
+            //选项在这里不处理 在ui层处理 所有这里不是走到1 直接return
             case 1:
                 EndDialogue();
-                break;
+                return;
+
             //进入战斗
             case 2:
                 LogTool.Log("对话结束,进入战斗");
                 break;
             //获得奖励
             case 3:
+                List<ItemInfo> itemInfos = new List<ItemInfo>();
+                for (var i = 0; i < dialogueConfig.PrizeIDs.Length; i++)
+                {
+                    ItemInfo itemInfo = new ItemInfo(dialogueConfig.PrizeIDs[i], dialogueConfig.PrizeNums[i]);
+                    itemInfos.Add(itemInfo);
+                }
+
+                await dialogue.OpenRewardsPanel(itemInfos);
                 LogTool.Log("对话结束,获得奖励");
                 break;
         }
+
+        //如果有下一个对话id 走下一个id
+        if (dialogueConfig.ResultOptions != null && dialogueConfig.ResultOptions[0] != 0)
+        {
+            PlayDialogue(dialogueConfig.ResultOptions[0]);
+        }
     }
 
 

+ 6 - 1
Assets/Scripts/GameLogic/EventManager/DialogueMono.cs

@@ -1,8 +1,13 @@
 using System;
+using System.Collections.Generic;
 using Common.Utility.CombatEvent;
+using Fort23.Core;
+using GameLogic.Bag;
 
-public interface DialogueMono
+public interface IDialogueMono
 {
     void OpenDialoguePanel(int id, string[] icon, ShowDialogueEventData.MessageShowType messageShowType,
         Action<int?> finish);
+
+    CTask OpenRewardsPanel(List<ItemInfo> rewardsDic, Action onClose = null, int titleId = 0);
 }

+ 25 - 0
Assets/Scripts/GameUI/DialogueMono.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using Common.Utility.CombatEvent;
+using Fort23.Core;
+using Fort23.Mono;
+using GameLogic.Bag;
+
+namespace GameUI
+{
+    public class DialogueMono : IDialogueMono
+    {
+        public void OpenDialoguePanel(int id, string[] icon, ShowDialogueEventData.MessageShowType messageShowType, Action<int?> finish)
+        {
+            DialoguePanel.OpenDialoguePanel(id, icon,messageShowType,finish);
+        }
+
+        public async CTask OpenRewardsPanel(List<ItemInfo> rewardsDic, Action onClose = null, int titleId = 0)
+        {
+            CTask cTask = CTask.Create();
+            RewardsPanel rewardsPanel = await RewardsPanel.OpenPanel(rewardsDic,onClose,titleId);
+            await rewardsPanel.UIClosed();
+            cTask.SetResult();
+        }
+    }
+}

+ 3 - 0
Assets/Scripts/GameUI/DialogueMono.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 0b2874b2722f474aac3fa3866064b2a6
+timeCreated: 1745378014

+ 1 - 0
Assets/Scripts/GameUI/GameApplction.cs

@@ -112,6 +112,7 @@ public class GameApplction : IGameStart
         //     LogTool.Error("登陆失败");
         //     return;
         // }
+        DialogueManager.Instance.CustomInit(new DialogueMono());
 
         PlayerManager.Instance.Init();
         // PlayerManager.Instance.InitTestHero();

+ 5 - 16
Assets/Scripts/GameUI/UI/CombatPanel/CombatPanel.cs

@@ -3,20 +3,15 @@ using System.Collections.Generic;
 using Common.Utility.CombatEvent;
 using Excel2Json;
 using Fort23.Core;
+using GameLogic.Bag;
 using GameLogic.Combat.CombatTool;
 using UnityEngine;
 
 namespace Fort23.Mono
 {
     [UIBinding(prefab = "CombatPanel")]
-    public partial class CombatPanel : UIPanel,DialogueMono
+    public partial class CombatPanel : UIPanel
     {
-        public override CTask<bool> AsyncInit(object[] uiData)
-        {
-            DialogueManager.Instance.CustomInit(this);
-            return base.AsyncInit(uiData);
-        }
-
         public static void OpenCombatPanel(CTaskAwaitBuffer cTaskAwaitBuffer)
         {
             cTaskAwaitBuffer.AddTask(UIManager.Instance.LoadAndOpenPanel<CombatPanel>(null, UILayer.Middle));
@@ -37,7 +32,7 @@ namespace Fort23.Mono
             CombatEventManager.Instance.AddEventListener(CombatEventType.GameStart, GameStart);
             CombatEventManager.Instance.AddEventListener(CombatEventType.AddMagicWeaponHeroEntity,
                 AddMagicWeaponHeroEntity);
-    
+
             StaticUpdater.Instance.AddLateUpdateCallBack(Update);
             CameraSelect.value = 0.7f;
         }
@@ -90,7 +85,6 @@ namespace Fort23.Mono
             CameraSelect.onValueChanged.AddListener(CameraSelect_onValueChanged);
             AutoUse.onValueChanged.AddListener((x) =>
             {
-              
                 CombatController.currActiveCombat.CombatHeroController.playerHeroEntity.MagicWeaponControl.isAutoUse =
                     x;
             });
@@ -102,8 +96,8 @@ namespace Fort23.Mono
             UIManager.Instance.DormancyAllGComponent<ShengShiEventWidget>();
             CombatController.currActiveCombat.CombatSenceController.StartPayShengShi(CombatController.currActiveCombat
                 .CombatHeroController.playerHeroEntity.GameObject.transform);
-            List<EventConfig> eventConfigs =  EventSystemManager.Instance.DetectEvents(1);
-            if(eventConfigs == null || eventConfigs.Count == 0)
+            List<EventConfig> eventConfigs = EventSystemManager.Instance.DetectEvents(1);
+            if (eventConfigs == null || eventConfigs.Count == 0)
                 return;
             for (var i = 0; i < eventConfigs.Count; i++)
             {
@@ -132,10 +126,5 @@ namespace Fort23.Mono
         public void Update()
         {
         }
-
-        public void OpenDialoguePanel(int id, string[] icon, ShowDialogueEventData.MessageShowType messageShowType, Action<int?> finish)
-        {
-            DialoguePanel.OpenDialoguePanel(id, icon,messageShowType,finish);
-        }
     }
 }

+ 9 - 7
Assets/Scripts/GameUI/UI/DialoguePanel/DialogueOptionWidget.cs

@@ -1,4 +1,6 @@
 using System;
+using System.Linq;
+using Core.Language;
 using Excel2Json;
 using Fort23.UTool;
 
@@ -9,6 +11,7 @@ namespace Fort23.Mono
     {
         public EventConditionConfig eventConditionConfig;
         private Action<DialogueOptionWidget> callback;
+
         private void Init()
         {
         }
@@ -23,18 +26,17 @@ namespace Fort23.Mono
 
         public override void AddButtonEvent()
         {
-            OptionWidget.onClick.AddListener(() =>
-            {
-                callback?.Invoke(this);
-            });
+            OptionWidget.onClick.AddListener(() => { callback?.Invoke(this); });
         }
 
-        
-        public void CustomInit(int id,Action<DialogueOptionWidget> callback)
+
+        public void CustomInit(int id, int mainOpid, Action<DialogueOptionWidget> callback)
         {
             eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(id);
+            var mainEventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(mainOpid);
+            int index = mainEventConditionConfig.optionPara1.ToList().IndexOf(eventConditionConfig.ID);
+            Text_desc.text = LanguageManager.Instance.Text(mainEventConditionConfig.optionPara2[index]);
             this.callback = callback;
         }
-        
     }
 }

+ 9 - 13
Assets/Scripts/GameUI/UI/DialoguePanel/DialoguePanel.cs

@@ -14,7 +14,7 @@ namespace Fort23.Mono
     {
         private int[] dialogueMessaga;
         private ShowDialogueEventData.MessageShowType messageShowType;
-        private Action<int?> finish; 
+        private Action<int?> finish;
         private int index;
         private char[] _currShowMessage;
         private float _showTime = 0.05f;
@@ -44,12 +44,10 @@ namespace Fort23.Mono
 
         protected override void AddEvent()
         {
-       
         }
 
         protected override void DelEvent()
         {
-            
         }
 
         public override void AddButtonEvent()
@@ -71,7 +69,7 @@ namespace Fort23.Mono
                 if (index >= dialogueMessaga.Length)
                 {
                     // 所有句子显示完成,检查是否有选项
-                    if (eventConditionConfig.optionType == 1  && !_isShowingOptions)
+                    if (eventConditionConfig.optionType == 1 && !_isShowingOptions)
                     {
                         ShowOptions();
                     }
@@ -88,7 +86,7 @@ namespace Fort23.Mono
 
         private void NextShow()
         {
-            if(_isShowingOptions)
+            if (_isShowingOptions)
                 return;
             if (_isUpdate)
             {
@@ -119,7 +117,7 @@ namespace Fort23.Mono
             if (index >= dialogueMessaga.Length)
             {
                 // 所有句子显示完成,检查是否有选项
-                if (eventConditionConfig.optionType == 1  && !_isShowingOptions)
+                if (eventConditionConfig.optionType == 1 && !_isShowingOptions)
                 {
                     ShowOptions();
                 }
@@ -129,6 +127,7 @@ namespace Fort23.Mono
                     UIManager.Instance.HideUIUIPanel(this);
                     finish?.Invoke(null);
                 }
+
                 return;
             }
 
@@ -164,18 +163,15 @@ namespace Fort23.Mono
         {
             UIManager.Instance.DormancyAllGComponent<DialogueOptionWidget>();
             _isShowingOptions = true;
-            
+
             foreach (var op in eventConditionConfig.optionPara1)
             {
                 // EventConditionConfig eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(op);
-             
+
                 DialogueOptionWidget dialogueOptionWidget =
-                    await UIManager.Instance.CreateGComponent<DialogueOptionWidget>(null,OptionRoot);
-                dialogueOptionWidget.CustomInit(op,SelectOption);
+                    await UIManager.Instance.CreateGComponent<DialogueOptionWidget>(null, OptionRoot);
+                dialogueOptionWidget.CustomInit(op, eventConditionConfig.ID, SelectOption);
             }
-
-
-   
         }
 
         private void SelectOption(DialogueOptionWidget obj)

+ 8 - 0
Assets/Scripts/GameUI/UI/RewardsPanel.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: WX8W5Cr/W33DQwUTU+q9ZZfgYZleOBQptR/RPqck4p0e80AtcYVezwDCR9RJ
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 95 - 0
Assets/Scripts/GameUI/UI/RewardsPanel/RewardsPanel.cs

@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using Core.Audio;
+using Core.Language;
+using Fort23.Core;
+using GameLogic.Bag;
+using NetCore.Protocol.MemoryPack;
+
+namespace Fort23.Mono
+{
+    [UIBinding(prefab = "RewardsPanel")]
+    public partial class RewardsPanel : UIPanel
+    {
+        private void Init()
+        {
+        }
+
+        protected override void AddEvent()
+        {
+        }
+
+        protected override void DelEvent()
+        {
+        }
+
+        public override void AddButtonEvent()
+        {
+            btnDi.onClick.AddListener(OnclickClose);
+        }
+
+        private void OnclickClose()
+        {
+            onClose?.Invoke();
+            UIManager.Instance.HideUIUIPanel(this);
+            UIManager.Instance.DormancyAllGComponent<WidgetItem>(rewardPool);
+        }
+
+        private Action onClose;
+        private string rewardPool = "rewardPool";
+
+        public override CTask Show()
+        {
+            AudioManager.Instance.PlayAudio("jiangliui.wav");
+            return base.Show();
+        }
+
+        public async void InitRewardsPanel(List<ItemInfo> rewards, Action onClose = null)
+        {
+            this.onClose = onClose;
+            foreach (ItemInfo reward in rewards)
+            {
+                GenerateWidget(reward);
+            }
+        }
+
+
+        public void SetTitle(string title)
+        {
+            txtlName.text = title;
+        }
+
+        public async void InitRewardsPanel(Dictionary<string, ItemInfo> rewardsDic, Action onClose = null)
+        {
+            this.onClose = onClose;
+            foreach (KeyValuePair<string, ItemInfo> keyValuePair in rewardsDic)
+            {
+                GenerateWidget(keyValuePair.Value);
+            }
+        }
+
+        private async void GenerateWidget(ItemInfo itemInfo)
+        {
+            WidgetItem widgetItem = await UIManager.Instance.CreateGComponent<WidgetItem>(null,
+                poolName: rewardPool, root: itemRoot);
+            widgetItem.InitWidget(itemInfo);
+        }
+
+
+        public async static CTask<RewardsPanel> OpenPanel(Dictionary<string, ItemInfo> rewardsDic, Action onClose = null)
+        {
+            RewardsPanel rewardsPanel = await UIManager.Instance.LoadAndOpenPanel<RewardsPanel>(null, layer: UILayer.Top);
+            rewardsPanel.InitRewardsPanel(rewardsDic, onClose);
+            return rewardsPanel;
+        }
+
+        public async static CTask<RewardsPanel> OpenPanel(List<ItemInfo> rewardsDic, Action onClose = null, int titleId = 0)
+        {
+            RewardsPanel rewardsPanel = await UIManager.Instance.LoadAndOpenPanel<RewardsPanel>(null, layer: UILayer.Top);
+            rewardsPanel.InitRewardsPanel(rewardsDic, onClose);
+            if (titleId != 0)
+                rewardsPanel.SetTitle(LanguageManager.Instance.Text(titleId));
+            return rewardsPanel;
+        }
+    }
+}

+ 11 - 0
Assets/Scripts/GameUI/UI/RewardsPanel/RewardsPanel.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: CX8Y5y+rW3opfagNz1zhRWMQ3hjg4Bcn7On6fIOqRVX0eFkKW7qkWoXG6kZE
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 73 - 0
Assets/Scripts/GameUI/UI/RewardsPanel/RewardsPanelData.cs

@@ -0,0 +1,73 @@
+using Fort23.Core;
+using Fort23.UTool;
+using UnityEngine.UI;
+using UnityEngine;
+using System.Collections.Generic;
+namespace Fort23.Mono
+{
+	public partial class RewardsPanel 
+	{
+	  #region 自定义数据 
+	  private Text _txtlName;
+	  public Text txtlName
+	   {
+	   get{
+	      if (_txtlName == null)
+	       {
+	         _txtlName  = GetUIUnit<Text>("txtlName"); 
+	       }
+	      return _txtlName;
+	     }
+	   }
+	  private GameObject _diObj;
+	  public GameObject diObj
+	   {
+	   get{
+	      if (_diObj == null)
+	       {
+	         _diObj  = GetUIUnit<GameObject>("diObj"); 
+	       }
+	      return _diObj;
+	     }
+	   }
+	  private RectTransform _itemRoot;
+	  public RectTransform itemRoot
+	   {
+	   get{
+	      if (_itemRoot == null)
+	       {
+	         _itemRoot  = GetUIUnit<RectTransform>("itemRoot"); 
+	       }
+	      return _itemRoot;
+	     }
+	   }
+	  private Button _btnDi;
+	  public Button btnDi
+	   {
+	   get{
+	      if (_btnDi == null)
+	       {
+	         _btnDi  = GetUIUnit<Button>("btnDi"); 
+	       }
+	      return _btnDi;
+	     }
+	   }
+	  private GameObject _widget;
+	  public GameObject widget
+	   {
+	   get{
+	      if (_widget == null)
+	       {
+	         _widget  = GetUIUnit<GameObject>("widget"); 
+	       }
+	      return _widget;
+	     }
+	   }
+	  #endregion 自定义数据结束 
+	 public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
+	{
+	 await base.SetUIGameObject(gObjectPoolInterface);
+	 Init();
+	}
+	}
+}

+ 11 - 0
Assets/Scripts/GameUI/UI/RewardsPanel/RewardsPanelData.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: Di5J5CKpWy604YznpVYJKogMOcA/iOOw4QhE6PiWMK//zz2yT3Ot4U/WeUyh
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 156 - 0
Assets/Scripts/GameUI/UI/RewardsPanel/WidgetItem.cs

@@ -0,0 +1,156 @@
+using System;
+using Core.Language;
+using Fort23.UTool;
+using GameLogic.Bag;
+using GameLogic.Equipment;
+using UnityEngine;
+using Utility;
+
+namespace Fort23.Mono
+{
+    [UIBinding(prefab = "WidgetItem")]
+    public partial class WidgetItem : UIComponent
+    {
+        public ItemInfo itemInfo;
+
+
+        private void Init()
+        {
+        }
+
+        public override void AddEvent()
+        {
+        }
+
+        public override void DelEvent()
+        {
+        }
+
+        public override void AddButtonEvent()
+        {
+            btnClick.onClick.AddListener(OnclickItem);
+        }
+
+        private Action onClickItem;
+
+        private async void OnclickItem()
+        {
+            if (onClickItem != null)
+            {
+                onClickItem.Invoke();
+                return;
+            }
+
+            if (itemInfo == null)
+            {
+                return;
+            }
+
+
+            // ItemPanel itemPanel = await UIManager.Instance.LoadAndOpenPanel<ItemPanel>(null, layer: UILayer.Top);
+            // itemPanel.InitItemPanel(itemInfo);
+        }
+
+        public void InitWidget(ItemInfo itemInfo, Action onClickItem = null)
+        {
+            this.itemInfo = itemInfo;
+
+            this.onClickItem = onClickItem;
+
+
+            border.gameObject.SetActive(false);
+            light.gameObject.SetActive(false);
+
+            heroShards.SetActive(false);
+
+
+            alertRed.SetActive(false);
+            icon.gameObject.SetActive(true);
+
+            if (itemInfo.count.Value > 0)
+            {
+                numObj.SetActive(true);
+                num.text = itemInfo.count.Value.ToStringEx();
+            }
+            else
+            {
+                numObj.SetActive(false);
+            }
+
+
+            if (itemInfo.eqInfo != null)
+            {
+                // icon.icon_name = HeroUITools.GetEquipmentIconName(itemInfo);
+
+                lvObj.SetActive(true);
+
+                // txtLv.text = itemInfo.eqInfo.level + "级";
+                txtLv.text = LanguageManager.Instance.Text(161, itemInfo.eqInfo.level);
+            }
+            else if (itemInfo.config.itemTyp == 5)
+            {
+                heroShards.SetActive(true);
+                icon.gameObject.SetActive(false);
+                heroShardsIcon.icon_name = itemInfo.config.icon;
+                lvObj.SetActive(false);
+            }
+            else
+            {
+                icon.icon_name = itemInfo.config.icon;
+                lvObj.SetActive(false);
+            }
+        }
+
+        /// <summary>
+        /// 设置单个装备的小红点
+        /// </summary>
+        /// <param name="oldEq"></param>
+        public bool SetEqItemRedPoint(ItemInfo best, int bwIdx)
+        {
+            //有更好的装备,且装备类型相同
+            if (best != null && best.eqInfo.basicEquipConfig.Type == bwIdx)
+            {
+                alertRed.SetActive(true);
+                // if (itemInfo == null)
+                // {
+                //     alertRed.SetActive(true);
+                // }
+                // //有装备,且装备类型相同,且装备等级更高
+                // if (itemInfo != null && best.eqInfo.basicEquipConfig.Type == eqTypIdx)
+                // {
+                //     alertRed.SetActive(true);
+                // }
+
+                return true;
+            }
+            else
+            {
+                alertRed.SetActive(false);
+            }
+
+            return false;
+        }
+
+        public void SetEmpty(Action onClickItem = null)
+        {
+            itemInfo = null;
+            this.onClickItem = onClickItem;
+
+            border.gameObject.SetActive(false);
+            light.gameObject.SetActive(false);
+
+            numObj.SetActive(false);
+            icon.gameObject.SetActive(false);
+            corner.gameObject.SetActive(false);
+            glow.gameObject.SetActive(false);
+            lvObj.SetActive(false);
+            heroShards.SetActive(false);
+            alertRed.SetActive(false);
+        }
+
+        public override void DormancyObj()
+        {
+            base.DormancyObj();
+        }
+    }
+}

+ 11 - 0
Assets/Scripts/GameUI/UI/RewardsPanel/WidgetItem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: Di8dvSyqUS8HHPwKdE4W56pnbnJ2A0LSBFMA2/wUJzP8wksLcgqz4OBZXuC3
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 174 - 0
Assets/Scripts/GameUI/UI/RewardsPanel/WidgetItemData.cs

@@ -0,0 +1,174 @@
+using Fort23.Core;
+using Fort23.UTool;
+using UnityEngine.UI;
+using UnityEngine;
+using System.Collections.Generic;
+using TMPro;
+
+namespace Fort23.Mono
+{
+	public partial class WidgetItem 
+	{
+	  #region 自定义数据 
+	  private Button _btnClick;
+	  public Button btnClick
+	   {
+	   get{
+	      if (_btnClick == null)
+	       {
+	         _btnClick  = GetUIUnit<Button>("btnClick"); 
+	       }
+	      return _btnClick;
+	     }
+	   }
+	  private MyImage _bg;
+	  public MyImage bg
+	   {
+	   get{
+	      if (_bg == null)
+	       {
+	         _bg  = GetUIUnit<MyImage>("bg"); 
+	       }
+	      return _bg;
+	     }
+	   }
+	  private MyImage _icon;
+	  public MyImage icon
+	   {
+	   get{
+	      if (_icon == null)
+	       {
+	         _icon  = GetUIUnit<MyImage>("icon"); 
+	       }
+	      return _icon;
+	     }
+	   }
+	  private TextMeshProUGUI _num;
+	  public TextMeshProUGUI num
+	   {
+	   get{
+	      if (_num == null)
+	       {
+	         _num  = GetUIUnit<TextMeshProUGUI>("num"); 
+	       }
+	      return _num;
+	     }
+	   }
+	  private GameObject _numObj;
+	  public GameObject numObj
+	   {
+	   get{
+	      if (_numObj == null)
+	       {
+	         _numObj  = GetUIUnit<GameObject>("numObj"); 
+	       }
+	      return _numObj;
+	     }
+	   }
+	  private GameObject _alertRed;
+	  public GameObject alertRed
+	   {
+	   get{
+	      if (_alertRed == null)
+	       {
+	         _alertRed  = GetUIUnit<GameObject>("alertRed"); 
+	       }
+	      return _alertRed;
+	     }
+	   }
+	  private MyImage _corner;
+	  public MyImage corner
+	   {
+	   get{
+	      if (_corner == null)
+	       {
+	         _corner  = GetUIUnit<MyImage>("corner"); 
+	       }
+	      return _corner;
+	     }
+	   }
+	  private MyImage _glow;
+	  public MyImage glow
+	   {
+	   get{
+	      if (_glow == null)
+	       {
+	         _glow  = GetUIUnit<MyImage>("glow"); 
+	       }
+	      return _glow;
+	     }
+	   }
+	  private MyImage _light;
+	  public MyImage light
+	   {
+	   get{
+	      if (_light == null)
+	       {
+	         _light  = GetUIUnit<MyImage>("light"); 
+	       }
+	      return _light;
+	     }
+	   }
+	  private MyImage _border;
+	  public MyImage border
+	   {
+	   get{
+	      if (_border == null)
+	       {
+	         _border  = GetUIUnit<MyImage>("border"); 
+	       }
+	      return _border;
+	     }
+	   }
+	  private GameObject _lvObj;
+	  public GameObject lvObj
+	   {
+	   get{
+	      if (_lvObj == null)
+	       {
+	         _lvObj  = GetUIUnit<GameObject>("lvObj"); 
+	       }
+	      return _lvObj;
+	     }
+	   }
+	  private Text _txtLv;
+	  public Text txtLv
+	   {
+	   get{
+	      if (_txtLv == null)
+	       {
+	         _txtLv  = GetUIUnit<Text>("txtLv"); 
+	       }
+	      return _txtLv;
+	     }
+	   }
+	  private GameObject _heroShards;
+	  public GameObject heroShards
+	   {
+	   get{
+	      if (_heroShards == null)
+	       {
+	         _heroShards  = GetUIUnit<GameObject>("heroShards"); 
+	       }
+	      return _heroShards;
+	     }
+	   }
+	  private MyImage _heroShardsIcon;
+	  public MyImage heroShardsIcon
+	   {
+	   get{
+	      if (_heroShardsIcon == null)
+	       {
+	         _heroShardsIcon  = GetUIUnit<MyImage>("heroShardsIcon"); 
+	       }
+	      return _heroShardsIcon;
+	     }
+	   }
+	  #endregion 自定义数据结束 
+	 public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
+	{
+	 await base.SetUIGameObject(gObjectPoolInterface);
+	 Init();
+	}
+	}
+}

+ 11 - 0
Assets/Scripts/GameUI/UI/RewardsPanel/WidgetItemData.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: DHwWvCusAS0SEllGkSsSNmo+p7wCHEfPLQZonwQEx4Lp9/OvqAVLo/7VwJ/N
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: