浏览代码

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

# Conflicts:
#	Excel2Json/Excel/DivineSenseConfig.xlsx   resolved by master version
邹舸 1 月之前
父节点
当前提交
8e7a833430
共有 24 个文件被更改,包括 944 次插入400 次删除
  1. 5 0
      Assets/Scripts/Core/Event/Event/CustomEventType.cs
  2. 4 4
      Assets/Scripts/Core/UI/Core/UIComponent.cs
  3. 15 3
      Assets/Scripts/Core/UI/Core/UIManager.cs
  4. 10 0
      Assets/Scripts/GameLogic/Combat/CombatState/CombatIdleState.cs
  5. 25 25
      Assets/Scripts/GameLogic/Combat/CombatState/CombatUpdateState.cs
  6. 14 1
      Assets/Scripts/GameLogic/Combat/CombatTool/CombatController.cs
  7. 14 2
      Assets/Scripts/GameLogic/Combat/CombatType/CombatTypeBasic.cs
  8. 130 109
      Assets/Scripts/GameLogic/Combat/CombatType/LevelBattleCombatType.cs
  9. 21 1
      Assets/Scripts/GameLogic/Combat/CombatType/TestCombatType.cs
  10. 1 1
      Assets/Scripts/GameLogic/Combat/Skill/S1201.cs
  11. 34 3
      Assets/Scripts/GameLogic/EventManager/DialogueManager.cs
  12. 1 0
      Assets/Scripts/GameLogic/EventManager/DialogueMono.cs
  13. 72 3
      Assets/Scripts/GameLogic/EventManager/EventSystemManager.cs
  14. 28 15
      Assets/Scripts/GameLogic/Player/AccountFileInfo.cs
  15. 31 2
      Assets/Scripts/GameUI/Combat/CombatDrive.cs
  16. 11 6
      Assets/Scripts/GameUI/DialogueMono.cs
  17. 1 1
      Assets/Scripts/GameUI/GameApplction.cs
  18. 5 1
      Assets/Scripts/GameUI/UI/CombatPanel/BossHpWidget.cs
  19. 31 49
      Assets/Scripts/GameUI/UI/CombatPanel/CombatPanel.cs
  20. 9 0
      Assets/Scripts/GameUI/UI/CombatPanel/HeroHpWidget.cs
  21. 6 3
      Assets/Scripts/GameUI/UI/CombatPanel/ShengShiEventWidget.cs
  22. 1 0
      Assets/Scripts/GameUI/UI/CombatPanel/ZhuanPanPanel.cs
  23. 29 5
      Assets/Scripts/GameUI/UI/MainPanel/MainPanel.cs
  24. 446 166
      UserSettings/Layouts/default-2022.dwlt

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

@@ -81,5 +81,10 @@ namespace Fort23.Core
       /// </summary>
       DivineSensePointChange,
       
+      /// <summary>
+      /// 完成事件
+      /// </summary>
+      CompleteEvent,
+      
     }
 }

+ 4 - 4
Assets/Scripts/Core/UI/Core/UIComponent.cs

@@ -41,7 +41,10 @@ namespace Fort23.Mono
         public virtual void ActiveObj()
         {
             _isActivePool = true;
-            own.SetActive(true);
+            if (own != null)
+            {
+                own.SetActive(true);
+            }
         }
 
         /// <summary>
@@ -136,8 +139,5 @@ namespace Fort23.Mono
         {
             _own = gameObject;
         }
-
-
-       
     }
 }

+ 15 - 3
Assets/Scripts/Core/UI/Core/UIManager.cs

@@ -245,7 +245,7 @@ namespace Fort23.Mono
                 UGUIIamgeTool.renderOrder = 0;
             }
 
-            if (Input.GetMouseButtonUp(0) && UILayers != null&&UICamera!=null)
+            if (Input.GetMouseButtonUp(0) && UILayers != null && UICamera != null)
             {
                 Vector3 pos = UICamera.ScreenToWorldPoint(Input.mousePosition);
                 GObjectPool.Instance.FetchAsync<ParticleSystemPool>("fx_ui_click.prefab",
@@ -253,9 +253,9 @@ namespace Fort23.Mono
                     {
                         if (pool != null)
                         {
-                            Transform t=  UILayers[^1];
+                            Transform t = UILayers[^1];
                             pool.transform.SetParent(t);
-                            pool.transform.position = new Vector3(pos.x, pos.y,t.transform.position.z);
+                            pool.transform.position = new Vector3(pos.x, pos.y, t.transform.position.z);
                         }
                     });
             }
@@ -676,6 +676,7 @@ namespace Fort23.Mono
                 else
                 {
                     gameObjectPool = Activator.CreateInstance<T>();
+                    gameObjectPool.ActiveObj();
                     // UIEventMono uiEventMono = newObject.GetComponent<UIEventMono>();
                     // if (uiEventMono != null)
                     // {
@@ -767,6 +768,17 @@ namespace Fort23.Mono
 
         public void DormancyGComponent(IGObjectPoolInterface poolInterface)
         {
+            if (poolInterface == null)
+            {
+                return;
+            }
+
+            if (string.IsNullOrEmpty(poolInterface.poolObjName))
+            {
+                poolInterface.DormancyObj();
+                return;
+            }
+
             GObjectPool.Instance.Recycle(poolInterface);
         }
 

+ 10 - 0
Assets/Scripts/GameLogic/Combat/CombatState/CombatIdleState.cs

@@ -1,4 +1,5 @@
 using GameLogic.Combat.CombatTool;
+using GameLogic.Combat.Hero;
 
 namespace GameLogic.Combat.CombatState
 {
@@ -7,5 +8,14 @@ namespace GameLogic.Combat.CombatState
         public CombatIdleState(CombatController combatController) : base(combatController)
         {
         }
+
+        protected override void ProEnter()
+        {
+            CombatHeroEntity playerHeroEntity = CombatController.currActiveCombat.CombatHeroController.playerHeroEntity;
+            if (playerHeroEntity != null)
+            {
+                playerHeroEntity.PlayAnim(CombatHeroStateType.idle, true, 0, false, 1);
+            }
+        }
     }
 }

+ 25 - 25
Assets/Scripts/GameLogic/Combat/CombatState/CombatUpdateState.cs

@@ -9,15 +9,15 @@ namespace GameLogic.Combat.CombatState
 {
     public class CombatUpdateState : CombatStateBasic
     {
-        /// <summary>
-        /// 下次遇见怪的时间
-        /// </summary>
-        private float _nextMonsterTime;
-
-        /// <summary>
-        /// 是否没有敌人
-        /// </summary>
-        protected bool isNullMonster;
+        // /// <summary>
+        // /// 下次遇见怪的时间
+        // /// </summary>
+        // private float _nextMonsterTime;
+        //
+        // /// <summary>
+        // /// 是否没有敌人
+        // /// </summary>
+        // protected bool isNullMonster;
 
         public CombatUpdateState(CombatController combatController) : base(combatController)
         {
@@ -38,8 +38,8 @@ namespace GameLogic.Combat.CombatState
                     new TriggerData());
             }
 
-            _nextMonsterTime = Random.Range(5, 10);
-            isNullMonster = true;
+            // _nextMonsterTime = Random.Range(5, 10);
+            // isNullMonster = true;
             CombatController.MagicWeaponCombatSence.CloseSecene();
         }
 
@@ -51,20 +51,20 @@ namespace GameLogic.Combat.CombatState
                 return;
             }
 
-            if (isNullMonster)
-            {
-                _nextMonsterTime -= t;
-
-                if (_nextMonsterTime < 0)
-                {
-                    isNullMonster = false;
-                    TestCombatType testCombatType = CombatController.currActiveCombat.CombatTypeBasic as TestCombatType;
-                    if (testCombatType != null)
-                    {
-                        testCombatType.CreateEnemy(new CTaskAwaitBuffer());
-                    }
-                }
-            }
+            // if (isNullMonster)
+            // {
+            //     _nextMonsterTime -= t;
+            //
+            //     if (_nextMonsterTime < 0)
+            //     {
+            //         isNullMonster = false;
+            //         TestCombatType testCombatType = CombatController.currActiveCombat.CombatTypeBasic as TestCombatType;
+            //         if (testCombatType != null)
+            //         {
+            //             testCombatType.CreateEnemy(new CTaskAwaitBuffer());
+            //         }
+            //     }
+            // }
 
 
             CombatHeroEntity[] allHero =

+ 14 - 1
Assets/Scripts/GameLogic/Combat/CombatTool/CombatController.cs

@@ -4,6 +4,7 @@ using Common.Utility.CombatTimer;
 using Core.Audio;
 using Core.Event.Event;
 using Core.State;
+using Excel2Json;
 using Fort23.Core;
 using GameLogic.Combat.CombatGuide;
 using GameLogic.Combat.CombatState;
@@ -19,6 +20,10 @@ namespace GameLogic.Combat.CombatTool
 {
     public class CombatController : ITimeLineAudio, IDisposable
     {
+        public static string idle = "idle";
+        public static string update = "update";
+        public static string fight = "fight";
+
         public static CombatController currActiveCombat;
         public CombatHeroController CombatHeroController;
         public CombatCameraControllder CombatCameraControllder;
@@ -30,7 +35,7 @@ namespace GameLogic.Combat.CombatTool
         public GameTimeLineParticleFactory GameTimeLineParticleFactory;
         public MagicWeaponCombatSence MagicWeaponCombatSence;
         public RandomEventController RandomEventController;
-        
+
         public bool isUpdate;
 
         /// <summary>
@@ -45,6 +50,8 @@ namespace GameLogic.Combat.CombatTool
         public bool IsGameOver;
         public bool IsFightState;
 
+        public System.Action<bool> combatFinish;
+
         public CombatStateBasic CurrState
         {
             get { return stateControl.CurrIState as CombatStateBasic; }
@@ -92,6 +99,7 @@ namespace GameLogic.Combat.CombatTool
             CombatEventManager.Instance.Dispatch(CombatEventType.GameStart, null);
         }
 
+
         private void RefreshFull(IEventData eventData)
         {
             RefreshFullEventData data = (RefreshFullEventData)eventData;
@@ -138,6 +146,11 @@ namespace GameLogic.Combat.CombatTool
             return await AudioManager.Instance.PlayAudio(audioName, isLoop);
         }
 
+        public void GameOver(bool isWin)
+        {
+            combatFinish?.Invoke(isWin);
+        }
+
         public void Dispose()
         {
             TimeLineSingletonEventManager.Instance.RemoveTimeLineBasic(this);

+ 14 - 2
Assets/Scripts/GameLogic/Combat/CombatType/CombatTypeBasic.cs

@@ -9,6 +9,7 @@ using UnityEngine;
 #if UNITY_WEIXINMINIGAME
 using WeChatWASM;
 #endif
+
 namespace GameLogic.Combat.CombatType
 {
     public class CombatTypeBasic : IDisposable
@@ -22,7 +23,7 @@ namespace GameLogic.Combat.CombatType
 
         protected CombatController combatController;
         protected int _currIndex = 0;
- 
+
 
         public IHero currBannerHero;
         public bool isActiveCombat = false;
@@ -52,7 +53,6 @@ namespace GameLogic.Combat.CombatType
         {
         }
 
-  
 
         private void OnTriggerEnterEvent(Collider collider)
         {
@@ -78,6 +78,18 @@ namespace GameLogic.Combat.CombatType
             await ProStartGame();
         }
 
+        /// <summary>
+        /// 开始战斗
+        /// </summary>
+        public async CTask StartCombat()
+        {
+            ProStartCombat();
+        }
+
+        protected async CTask ProStartCombat()
+        {
+        }
+
         public void Dispose()
         {
             CombatEventManager.Instance.RemoveEventListener(CombatEventType.HeroDie, HeroDieEventData);

+ 130 - 109
Assets/Scripts/GameLogic/Combat/CombatType/LevelBattleCombatType.cs

@@ -4,6 +4,7 @@ using CombatLibrary.CombatLibrary.CombatCore;
 using Common.Utility.CombatEvent;
 using Common.Utility.CombatTimer;
 using Core.Audio;
+using Core.Utility;
 using Excel2Json;
 using Fort23.Core;
 using Fort23.Mono;
@@ -21,114 +22,134 @@ namespace GameLogic.Combat.CombatType
 {
     public class LevelBattleCombatType : CombatTypeBasic
     {
-       
-
-
-        //
-        //
-        // protected override void ProHeroDie(CombatHeroEntity combatHeroEntity, HarmReturnInfo harmReturnInfo)
-        // {
-        //
-        // }
-        //
-        //
-        // private void PlayBgm()
-        // {
-        //     AudioManager.Instance.PlayBGM("combatBattle.wav");
-        // }
-        //
-        // private void ResurrectionFinish()
-        // {
-        //   
-        // }
-        //
-        //
-        //
-        //
-        //
-        //
-        // protected override async CTask ProStartGame()
-        // {
-        //     CTaskAwaitBuffer cTaskAwaitBuffer = new CTaskAwaitBuffer();
-        //     // TestCombat(cTaskAwaitBuffer);
-        //     InitPlayerHero(cTaskAwaitBuffer);
-        //     InitTestCombatBoChi();
-        //     CreateEnemy(cTaskAwaitBuffer);
-        //     await cTaskAwaitBuffer.WaitAll();
-        //     CombatController.currActiveCombat.CombatHeroController.SetFollowTarget();
-        // }
-        //
-        //
-        //
-        //
-        // public void StartBossCombat()
-        // {
-        //
-        // }
-        //
-        // public void StartBossBattle()
-        // {
-        //     CombatController.currActiveCombat.isStopAi = false;
-        // }
-        //
-        //
-        // protected void InitTestCombatBoChi()
-        // {
-        //
-        // }
-        //
-        //
-        // private void CreateEnemy(CTaskAwaitBuffer cTaskAwaitBuffer)
-        // {
-        //
-        // }
-        //
-        // private void CreateEnemy(CTaskAwaitBuffer cTaskAwaitBuffer, int monsterId, int level, int star, int index,
-        //     Vector3 pos,
-        //     System.Action<CombatHeroEntity> callBack = null)
-        // {
-        //     CombatHeroEntity heroEntity = CObjectPool.Instance.Fetch<CombatHeroEntity>();
-        //     heroEntity.IsEnemy = true;
-        //     CombatHeroInfo combatHeroInfo = new CombatHeroInfo();
-        //     combatHeroInfo.InitMonster(monsterId, level, star);
-        //
-        //     cTaskAwaitBuffer.AddTask(heroEntity.Init(new CombatAIBasic(), combatHeroInfo, pos,
-        //         delegate(CombatHeroEntity entity)
-        //         {
-        //             combatController.CombatHeroController.AddHero(entity);
-        //             callBack?.Invoke(entity);
-        //         }));
-        // }
-        //
-        //
-        //
-        // protected override void ProUpdate(float t)
-        // {
-        //
-        // }
-        //
-        //
-        // private void InitPlayerHero(CTaskAwaitBuffer cTaskAwaitBuffer)
-        // {
-        //     // int i = 0;
-        //     // foreach (KeyValuePair<int, HeroInfo> keyValuePair in PlayerManager.Instance.heroController.heroDicInLead)
-        //     // {
-        //     //     int index = i;
-        //     //     CombatHeroEntity heroEntity = CObjectPool.Instance.Fetch<CombatHeroEntity>();
-        //     //     heroEntity.IsEnemy = false;
-        //     //     heroEntity.number = i;
-        //     //     Vector3 pos = _combatScenesConfig.heroPoint[index].position;
-        //     //     cTaskAwaitBuffer.AddTask(heroEntity.Init(new CombatAIBasic(), keyValuePair.Value, pos,
-        //     //         delegate(CombatHeroEntity entity) { combatController.CombatHeroController.AddHero(entity); }));
-        //     //
-        //     //     i++;
-        //     // }
-        //     //
-        //     // Vector3 p = _combatScenesConfig.heroPoint[0].position;
-        //     // combatController.CombatCameraControllder.root.position = new Vector3(p.x,
-        //     //     combatController.CombatCameraControllder.root.position.y, p.z + 13);
-        // }
-
-       
+        private float _currTime;
+
+        private int _currBoChi;
+
+
+        protected Vector3[] enemyHeroPosOff =
+        {
+            new Vector3(0, 0, 0),
+            new Vector3(2, 0, -2),
+            new Vector3(-2, 0, -2)
+        };
+
+        protected override void ProInit()
+        {
+        }
+
+        protected override void ProHeroDie(CombatHeroEntity combatHeroEntity, HarmReturnInfo harmReturnInfo)
+        {
+            CombatHeroEntity[] allHero = combatController.CombatHeroController.GetHero(true);
+            if (allHero==null||allHero.Length <= 0)
+            {
+                //胜利
+                CombatController.currActiveCombat.GameOver(true);
+                return;
+            }
+
+            allHero = combatController.CombatHeroController.GetHero(false);
+            if (allHero==null||allHero.Length <= 0)
+            {
+                //失败
+                CombatController.currActiveCombat.GameOver(false);
+                return;
+            }
+        }
+
+
+        protected override async CTask ProStartGame()
+        {
+            CTaskAwaitBuffer cTaskAwaitBuffer = new CTaskAwaitBuffer();
+            TestCombat(cTaskAwaitBuffer);
+
+            await cTaskAwaitBuffer.WaitAll();
+            CombatController.currActiveCombat.CombatHeroController.SetFollowTarget();
+        }
+
+
+        public async CTask LoadCombat(int levelBattleId, System.Action<bool> caombatFinish)
+        {
+            LevelbattleConfig levelbattleConfig = ConfigComponent.Instance.Get<LevelbattleConfig>(levelBattleId);
+            CTaskAwaitBuffer cTaskAwaitBuffer = new CTaskAwaitBuffer();
+            for (int i = 0; i < levelbattleConfig.Group.Length; i++)
+            {
+                int group = levelbattleConfig.Group[i];
+                GroupConfig groupConfig = ConfigComponent.Instance.Get<GroupConfig>(group);
+                int[] monster = groupConfig.GroupMonster;
+                int level = groupConfig.GroupMonsterLevel;
+                if (level < 0)
+                {
+                    level = PlayerManager.Instance.myHero.level.Value;
+                }
+
+                for (int j = 0; j < monster.Length; j++)
+                {
+                    HeroInfo heroInfo = new HeroInfo();
+                    heroInfo.InitMonster(monster[j],level);
+                    CreateEnemy(cTaskAwaitBuffer, heroInfo, j);
+                }
+            }
+
+            await cTaskAwaitBuffer.WaitAll();
+            cTaskAwaitBuffer.Dispose();
+        }
+
+        public void CreateEnemy(CTaskAwaitBuffer cTaskAwaitBuffer, HeroInfo heroInfo, int index)
+        {
+            // return;
+            _currBoChi += 1;
+            float d = CombatController.currActiveCombat.CombatSenceController.currTime + 0.4f;
+            Vector3 startPos =
+                CombatController.currActiveCombat.CombatSenceController.GetTarget(d) + new Vector3(0, 1, 0);
+            Vector3 startPos2 =
+                CombatController.currActiveCombat.CombatSenceController.GetTarget(d + 0.01f) + new Vector3(0, 1, 0);
+            Vector3 dir = startPos2 - startPos;
+            Quaternion quaternion = Quaternion.LookRotation(dir);
+
+
+            CombatHeroEntity heroEntity = new CombatHeroEntity();
+            heroEntity.IsEnemy = true;
+            Vector3 pos = startPos + quaternion * enemyHeroPosOff[index];
+            cTaskAwaitBuffer.AddTask(heroEntity.Init(new CombatHeroAi(), heroInfo, pos,
+                delegate(CombatHeroEntity entity) { combatController.CombatHeroController.AddHero(entity); }));
+        }
+
+        protected override void ProUpdate(float t)
+        {
+            if (!isActiveCombat)
+            {
+                return;
+            }
+        }
+
+        private void TestCombat(CTaskAwaitBuffer cTaskAwaitBuffer)
+        {
+            Vector3 heroPoint = CombatController.currActiveCombat.CombatSenceController.GetTarget(0);
+            CombatController.currActiveCombat.MagicWeaponCombatSence.SetMagicWeaponCombatSence(heroPoint,
+                Vector3.forward);
+            TestCombatHeroConfig testCombatHeroConfig = GameObject.FindObjectOfType<TestCombatHeroConfig>();
+            if (testCombatHeroConfig != null)
+            {
+                TestCombatHeroConfig.TestHeroInfoConfig testHeroInfoConfig = testCombatHeroConfig.myHeroInfo[0];
+                PlayerManager.Instance.AddTestHeroInfo(testHeroInfoConfig.heroID, testHeroInfoConfig.level,
+                    testHeroInfoConfig.skill, testHeroInfoConfig.magicWeaponId);
+
+
+                CombatHeroEntity heroEntity = new CombatHeroEntity();
+                CombatController.currActiveCombat.CombatHeroController.playerHeroEntity = heroEntity;
+                heroEntity.IsEnemy = false;
+                heroEntity.number = 0;
+
+                Vector3 pos = heroPoint;
+                cTaskAwaitBuffer.AddTask(heroEntity.Init(new CombatHeroAi(), PlayerManager.Instance.myHero, pos,
+                    delegate(CombatHeroEntity entity)
+                    {
+                        entity.CurrCombatHeroInfo.hp = (EncryptionLong)(20000);
+                        entity.MaxCombatHeroInfo.hp = (EncryptionLong)(20000);
+                        combatController.CombatHeroController.AddHero(entity);
+                    }, isPlayer: true));
+            }
+        }
     }
 }

+ 21 - 1
Assets/Scripts/GameLogic/Combat/CombatType/TestCombatType.cs

@@ -1,6 +1,7 @@
 using System.Collections.Generic;
 using Common.Utility.CombatEvent;
 using Core.Utility;
+using Excel2Json;
 using Fort23.Core;
 using Fort23.UTool;
 using GameLogic.Combat.CombatTool;
@@ -69,6 +70,25 @@ namespace GameLogic.Combat.CombatType
             currEnemyIndex++;
         }
 
+        public async CTask LoadCombat(int levelBattleId)
+        {
+            LevelbattleConfig levelbattleConfig = ConfigComponent.Instance.Get<LevelbattleConfig>(levelBattleId);
+            CTaskAwaitBuffer cTaskAwaitBuffer = new CTaskAwaitBuffer();
+            for (int i = 0; i < levelbattleConfig.Group.Length; i++)
+            {
+                int group = levelbattleConfig.Group[i];
+                GroupConfig groupConfig = ConfigComponent.Instance.Get<GroupConfig>(group);
+                int[] monster = groupConfig.GroupMonster;
+                for (int j = 0; j < monster.Length; j++)
+                {
+                    
+                }
+            }
+
+            await cTaskAwaitBuffer.WaitAll();
+            cTaskAwaitBuffer.Dispose();
+        }
+
         public void CreateEnemy(CTaskAwaitBuffer cTaskAwaitBuffer)
         {
             // return;
@@ -77,7 +97,7 @@ namespace GameLogic.Combat.CombatType
             Vector3 startPos =
                 CombatController.currActiveCombat.CombatSenceController.GetTarget(d) + new Vector3(0, 1, 0);
             Vector3 startPos2 =
-                CombatController.currActiveCombat.CombatSenceController.GetTarget(d+0.01f) + new Vector3(0, 1, 0);
+                CombatController.currActiveCombat.CombatSenceController.GetTarget(d + 0.01f) + new Vector3(0, 1, 0);
             Vector3 dir = startPos2 - startPos;
             Quaternion quaternion = Quaternion.LookRotation(dir);
             for (int i = 0; i < enemyHeroInfo.Count; i++)

+ 1 - 1
Assets/Scripts/GameLogic/Combat/Skill/S1201.cs

@@ -28,7 +28,7 @@ namespace GameLogic.Combat.Skill
 
         protected void FaShe()
         {
-            if (currCount > 3||CombatHeroEntity==null||CombatHeroEntity.CombatAIBasic==null)
+            if (currCount > 3||CombatHeroEntity==null||CombatHeroEntity.CombatAIBasic==null||CombatHeroEntity.CombatAIBasic.currFocusTarget==null)
             {
                 return;
             }

+ 34 - 3
Assets/Scripts/GameLogic/EventManager/DialogueManager.cs

@@ -40,6 +40,12 @@ public class DialogueManager : Singleton<DialogueManager>
     {
         currentDialogueID = dialogueID;
 
+        //神识探索的事件记录步骤
+        if (EventSystemManager.Instance.CurrentEventList != null)
+            EventSystemManager.Instance.CurrentEventList.curStep = currentDialogueID;
+
+        AccountFileInfo.Instance.SavePlayerData();
+
 
         // 找到当前对话组
         var dialogueConfig = ConfigComponent.Instance.Get<EventConditionConfig>(dialogueID);
@@ -52,7 +58,8 @@ public class DialogueManager : Singleton<DialogueManager>
         //挂机事件 弹出简单气泡对话
         if (eventConfig.EventTriggerType != 2)
         {
-            dialogue.OpenDialoguePanel(dialogueConfig.ID, null, ShowDialogueEventData.MessageShowType.Verbatim, FishDialogue);
+            dialogue.OpenDialoguePanel(dialogueConfig.ID, null, ShowDialogueEventData.MessageShowType.Verbatim,
+                FishDialogue);
         }
         else
         {
@@ -88,6 +95,7 @@ public class DialogueManager : Singleton<DialogueManager>
     private async void EndDialogue1()
     {
         EventConditionConfig dialogueConfig = ConfigComponent.Instance.Get<EventConditionConfig>(currentDialogueID);
+        bool isCombatWin = false;
         switch (dialogueConfig.optionType)
         {
             //选项在这里不处理 在ui层处理 所有这里不是走到1 直接return
@@ -98,6 +106,15 @@ public class DialogueManager : Singleton<DialogueManager>
             //进入战斗
             case 2:
                 LogTool.Log("对话结束,进入战斗");
+                CTask cTask = CTask.Create();
+                dialogue.StartCombat(dialogueConfig.optionPara1[0],
+                    delegate(bool isWin)
+                    {
+                        LogTool.Log("战斗完成" + isWin);
+                        isCombatWin = isWin;
+                        cTask.SetResult();
+                    });
+                await cTask;
                 break;
             //获得奖励
             case 3:
@@ -114,9 +131,23 @@ public class DialogueManager : Singleton<DialogueManager>
         }
 
         //如果有下一个对话id 走下一个id
-        if (dialogueConfig.ResultOptions != 0)
+        if (dialogueConfig.ResultOptions != null && dialogueConfig.ResultOptions.Length > 0)
         {
-            PlayDialogue(dialogueConfig.ResultOptions);
+            if (dialogueConfig.optionType == 2)
+            {
+                if (isCombatWin)
+                {
+                    PlayDialogue(dialogueConfig.ResultOptions[0]);
+                }
+                else
+                {
+                    PlayDialogue(dialogueConfig.ResultOptions[1]);
+                }
+            }
+            else
+            {
+                PlayDialogue(dialogueConfig.ResultOptions[0]);
+            }
         }
         else
         {

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

@@ -12,4 +12,5 @@ public interface IDialogueMono
     CTask OpenRewardsPanel(List<ItemInfo> rewardsDic, Action onClose = null, int titleId = 0);
 
     CTask OpenDialoguePanel(int id, Action<int?> finish);
+    void StartCombat(int levelBattle,System.Action<bool> finishCombat);
 }

+ 72 - 3
Assets/Scripts/GameLogic/EventManager/EventSystemManager.cs

@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Linq;
+using Core.Language;
 using Excel2Json;
 using Fort23.Core;
 using Fort23.UTool;
@@ -13,6 +14,8 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
     List<AccountFileInfo.EventData> eventDatas = new List<AccountFileInfo.EventData>();
 
+    public AccountFileInfo.EventList CurrentEventList;
+
     public void CustomInit()
     {
         eventConfigs = ConfigComponent.Instance.GetAll<EventConfig>().ToList();
@@ -34,7 +37,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         }
     }
 
-    public List<EventConfig> UseDivinesense(int bigMapId)
+    public List<AccountFileInfo.EventList> UseDivinesense(int bigMapId)
     {
         DivineSenseConfig divineSenseConfig = ConfigComponent.Instance.Get<DivineSenseConfig>(AccountFileInfo.Instance.playerData.divineSenseLevel);
         int count = AccountFileInfo.Instance.playerData.divineSensePoint / PlayerManager.Instance.gameConstantConfig.DetectEventCount;
@@ -50,7 +53,19 @@ public class EventSystemManager : Singleton<EventSystemManager>
         //todo 神识升级逻辑
         AccountFileInfo.Instance.SavePlayerData();
 
-        return DetectEvents(bigMapId, count);
+        var eventConfigs = DetectEvents(bigMapId, count);
+        if (eventConfigs == null || eventConfigs.Count == 0)
+            return default;
+
+        List<AccountFileInfo.EventList> eventLists = new List<AccountFileInfo.EventList>();
+        for (var i = 0; i < eventConfigs.Count; i++)
+        {
+            AccountFileInfo.EventList eventList = new AccountFileInfo.EventList();
+            eventList.eventID = eventConfigs[i].ID;
+            eventLists.Add(eventList);
+        }
+
+        return eventLists;
     }
 
 
@@ -59,7 +74,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         BigMap bigMap = ConfigComponent.Instance.Get<BigMap>(bigMapId);
         DivineSenseConfig divineSenseConfig = ConfigComponent.Instance.Get<DivineSenseConfig>(AccountFileInfo.Instance.playerData.divineSenseLevel);
 
-        List<int> qualitys = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+        List<int> qualitys = new List<int>() { 1, 2, 3, 4, 5, 6 };
 
         //先掉落出品质
         int quality = UtilTools.GetRandomByWeight(qualitys, divineSenseConfig.QualityBonusChance);
@@ -140,6 +155,29 @@ public class EventSystemManager : Singleton<EventSystemManager>
         DialogueManager.Instance.StartDialogue(evt.EventType, evt.ID, () => { CompleteEvent(evt.ID); });
     }
 
+    /// <summary>
+    /// 触发事件
+    /// </summary>
+    public void TriggerEvent(AccountFileInfo.EventList evt)
+    {
+        EventConfig eventConfig = ConfigComponent.Instance.Get<EventConfig>(evt.eventID);
+        LogTool.Log($"触发事件: {LanguageManager.Instance.Text(eventConfig.Description)} (ID: {eventConfig.ID}, 品质: {eventConfig.EventQuality})");
+
+        int dialogueID = 0;
+        if (evt.curStep == 0)
+        {
+            dialogueID = eventConfig.EventType;
+        }
+        else
+        {
+            dialogueID = evt.curStep;
+        }
+
+        CurrentEventList = evt;
+
+        DialogueManager.Instance.StartDialogue(dialogueID, eventConfig.ID, () => { CompleteEvent(); });
+    }
+
     /// <summary>
     /// 检查事件是否满足触发条件。
     /// </summary>
@@ -200,6 +238,37 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
         if (AccountFileInfo.Instance.playerData.senceExplorationProgress < 100)
             AccountFileInfo.Instance.playerData.senceExplorationProgress += 5;
+
+
         AccountFileInfo.Instance.SavePlayerData();
+
+        // EventManager.Instance.Dispatch(CustomEventType.CompleteEvent, null);
+    }
+
+    /// <summary>
+    /// 完成事件
+    /// </summary>
+    /// <param name="eventID">事件ID</param>
+    public void CompleteEvent()
+    {
+        LogTool.Log($"完成事件{CurrentEventList.eventID}");
+        AccountFileInfo.EventData eventData = AccountFileInfo.Instance.playerData.events.FirstOrDefault((e) => e.eventID == CurrentEventList.eventID);
+        if (eventData == null)
+        {
+            eventData = new AccountFileInfo.EventData();
+            eventData.eventID = CurrentEventList.eventID;
+        }
+
+        eventData.completeCount++;
+        AccountFileInfo.Instance.playerData.events.Add(eventData);
+
+        if (AccountFileInfo.Instance.playerData.senceExplorationProgress < 100)
+            AccountFileInfo.Instance.playerData.senceExplorationProgress += 5;
+
+
+        AccountFileInfo.Instance.playerData.eventList.Remove(CurrentEventList);
+        AccountFileInfo.Instance.SavePlayerData();
+
+        EventManager.Instance.Dispatch(CustomEventType.CompleteEvent, null);
     }
 }

+ 28 - 15
Assets/Scripts/GameLogic/Player/AccountFileInfo.cs

@@ -29,18 +29,21 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
     {
         //地图探索进度
         public int senceExplorationProgress;
-        
+
         public int divineSenseLevel = 1;
-        
+
         public int divineSensePoint = 0;
-        
+
         public int divineSenseexp = 0;
-        
+
         public List<EventData> events = new List<EventData>();
-        
+
+        public List<EventList> eventList = new List<EventList>();
+
+
         public List<ItemData> ItemListData = new List<ItemData>();
 
-      
+
         /// <summary>
         /// 关卡进度
         /// </summary>
@@ -65,14 +68,27 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         // /// </summary>
         // public List<HeroData> HeroListInBackDatas = new List<HeroData>();
     }
-    
+
+    [System.Serializable]
     public class EventData
     {
-        public int eventID ;
+        public int eventID;
+
         //完成cishu
         public int completeCount = 0;
     }
 
+    /// <summary>
+    /// 刷出来的事件列表
+    /// </summary>
+    [System.Serializable]
+    public class EventList
+    {
+        public int eventID;
+
+        public int curStep;
+    }
+
 
     /// <summary>
     /// 重建索引表
@@ -130,7 +146,6 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
 
     private int lastHeroIdx = 0;
 
-  
 
     private int lastItemIdx = 0;
 
@@ -285,19 +300,18 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
     public void ClearInitPlayerData()
     {
         ItemData coin = new ItemData(GlobalParam.Item_Coin_ID, 0);
-        
+
         ItemData diamond = new ItemData(GlobalParam.Item_Diamond_ID);
-        
+
         ItemData heroExp = new ItemData(GlobalParam.Item_HeroExp_ID, 0);
-        
+
         playerData.ItemListData.Add(coin);
         playerData.ItemListData.Add(diamond);
         playerData.ItemListData.Add(heroExp);
-        
+
         // BagController.Instance.AddCoin(10000);
 
 
-       
         // playerData.HeroListData.Add(heroData2);
         // playerData.HeroListData.Add(heroData3);
         // playerData.HeroListData.Add(heroData4);
@@ -316,7 +330,6 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         /// 英雄等级
         /// </summary>
         public int heroPowerId;
-        
     }
 
     [System.Serializable]

+ 31 - 2
Assets/Scripts/GameUI/Combat/CombatDrive.cs

@@ -17,6 +17,8 @@ namespace GameLogic.Combat
 
         private CombatMonoBaisc combatMonoBaisc;
 
+        private System.Action<bool> caombatFinish;
+
         public async CTask Init()
         {
             string name = "CombatRoot.prefab";
@@ -37,19 +39,46 @@ namespace GameLogic.Combat
             CombatEquipFallManager.Instance.Dispose();
             CombatEquipFallManager.Instance.Init();
             CTaskAwaitBuffer cTaskAwaitBuffer = new CTaskAwaitBuffer();
-            CombatPanel.OpenCombatPanel(cTaskAwaitBuffer);
+            // CombatPanel.OpenCombatPanel(cTaskAwaitBuffer);
             CombatShowTextPanel.OpenCombatShowTextPanel(cTaskAwaitBuffer);
 
             cTaskAwaitBuffer.AddTask(combatMonoBaisc.Init(CombatController));
             await cTaskAwaitBuffer.WaitAll();
             await CombatHPPanel.OpenCombatHPPanel();
-         
+
 
             LogTool.Log("战斗逻辑自己写");
             await CombatController.InitCombat(startCombatInfo);
             StaticUpdater.Instance.AddRenderUpdateCallBack(Update);
         }
 
+        public async CTask LoadLevelBattleCombat(int levelBattleId, System.Action<bool> caombatFinish)
+        {
+            this.caombatFinish = caombatFinish;
+            CombatController.ChangeState(CombatController.idle);
+            LevelBattleCombatType levelBattleCombatType = CombatController.CombatTypeBasic as LevelBattleCombatType;
+            if (levelBattleCombatType != null)
+            {
+                CombatController.combatFinish = CombatFinish;
+                await levelBattleCombatType.LoadCombat(levelBattleId, caombatFinish);
+            }
+
+            await CombatPanel.OpenCombatPanel();
+            ///播放动画
+            MainPanel mainPanel = UIManager.Instance.GetComponent<MainPanel>();
+            mainPanel.transform.gameObject.SetActive(false);
+            CombatController.ChangeState(CombatController.update);
+        }
+
+        protected void CombatFinish(bool isWin)
+        {
+            caombatFinish?.Invoke(isWin);
+            ///播放动画
+            MainPanel mainPanel = UIManager.Instance.GetComponent<MainPanel>();
+            mainPanel.transform.gameObject.SetActive(true);
+            UIManager.Instance.HideUIUIPanel<CombatPanel>();
+        }
+
         public void Update()
         {
             float t = Time.deltaTime;

+ 11 - 6
Assets/Scripts/GameUI/DialogueMono.cs

@@ -4,29 +4,34 @@ using Common.Utility.CombatEvent;
 using Fort23.Core;
 using Fort23.Mono;
 using GameLogic.Bag;
+using GameLogic.Combat;
 
 namespace GameUI
 {
     public class DialogueMono : IDialogueMono
     {
-        public void OpenDialoguePanel(int id, string[] icon, ShowDialogueEventData.MessageShowType messageShowType, Action<int?> finish)
+        public void OpenDialoguePanel(int id, string[] icon, ShowDialogueEventData.MessageShowType messageShowType,
+            Action<int?> finish)
         {
-            DialoguePanel.OpenDialoguePanel(id, icon,messageShowType,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);
+            RewardsPanel rewardsPanel = await RewardsPanel.OpenPanel(rewardsDic, onClose, titleId);
             await rewardsPanel.UIClosed();
             cTask.SetResult();
         }
 
-        public async CTask OpenDialoguePanel(int id,  Action<int?> finish)
+        public async CTask OpenDialoguePanel(int id, Action<int?> finish)
         {
-           await DialogueBubblePanel.OpenDialoguePanel(id, finish);
+            await DialogueBubblePanel.OpenDialoguePanel(id, finish);
         }
 
-     
+        public void StartCombat(int levelBattle, Action<bool> finishCombat)
+        {
+            CombatDrive.Instance.LoadLevelBattleCombat(levelBattle, finishCombat);
+        }
     }
 }

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

@@ -124,7 +124,7 @@ public class GameApplction : IGameStart
         TestCombatHeroConfig testCombatHeroConfig = GameObject.FindObjectOfType<TestCombatHeroConfig>();
         if (testCombatHeroConfig != null)
         {
-            startCombatInfo.CombatType = CombatType.TestCombat;
+            startCombatInfo.CombatType = CombatType.LevelBattle;
         }
 #endif
 

+ 5 - 1
Assets/Scripts/GameUI/UI/CombatPanel/BossHpWidget.cs

@@ -17,6 +17,7 @@ namespace Fort23.Mono
 
         protected BetterList<gf_widget> currShowGfWidget = new BetterList<gf_widget>();
 
+        private HeroHpWidget heroHpWidget;
         private void Init()
         {
         }
@@ -29,6 +30,9 @@ namespace Fort23.Mono
         public override void DelEvent()
         {
             CombatEventManager.Instance.RemoveEventListener(CombatEventType.UseSkill, UseSkill);
+            UIManager.Instance.DormancyGComponent(heroHpWidget);
+            heroHpWidget = null;
+            UIManager.Instance.DormancyAllGComponent<gf_widget>("bossWidget");
         }
 
         public override void AddButtonEvent()
@@ -112,7 +116,7 @@ namespace Fort23.Mono
             this.combatHeroEntity = combatHeroEntity;
             combatHeroSkillControl =
                 combatHeroEntity.CombatHeroSkillControl as CombatHeroSkillControl;
-            HeroHpWidget heroHpWidget =
+             heroHpWidget =
                 await UIManager.Instance.CreateGComponentForObject<HeroHpWidget>(HeroHpWidget, null);
             heroHpWidget.size = 250;
             heroHpWidget.shieldSize = 100;

+ 31 - 49
Assets/Scripts/GameUI/UI/CombatPanel/CombatPanel.cs

@@ -14,10 +14,12 @@ namespace Fort23.Mono
     public partial class CombatPanel : UIPanel
     {
         private ZhuanPanPanel zhuanPanLogic;
+        private HeroHpWidget playerHeroHpWidget;
 
-        public static void OpenCombatPanel(CTaskAwaitBuffer cTaskAwaitBuffer)
+        public static async CTask OpenCombatPanel()
         {
-            cTaskAwaitBuffer.AddTask(UIManager.Instance.LoadAndOpenPanel<CombatPanel>(null, UILayer.Middle));
+            CombatPanel combatPanel = await UIManager.Instance.LoadAndOpenPanel<CombatPanel>(null, UILayer.Middle);
+            await combatPanel.ShowPanel();
         }
 
         protected override async CTask ProOpen()
@@ -31,10 +33,18 @@ namespace Fort23.Mono
         {
         }
 
+        public override void Hide()
+        {
+            base.Hide();
+            UIManager.Instance.DormancyGComponent(zhuanPanLogic);
+            zhuanPanLogic = null;
+            UIManager.Instance.DormancyAllGComponent<BossHpWidget>();
+            UIManager.Instance.DormancyGComponent(playerHeroHpWidget);
+            playerHeroHpWidget = null;
+        }
+
         protected override void AddEvent()
         {
-            CombatEventManager.Instance.AddEventListener(CombatEventType.AddRandomEvent, AddRandomEventEventData);
-            CombatEventManager.Instance.AddEventListener(CombatEventType.GameStart, GameStart);
             CombatEventManager.Instance.AddEventListener(CombatEventType.AddMagicWeaponHeroEntity,
                 AddMagicWeaponHeroEntity);
             CombatEventManager.Instance.AddEventListener(CombatEventType.AddUseGongFa, AddUseGongFa);
@@ -43,6 +53,15 @@ namespace Fort23.Mono
             CameraSelect.value = 0.7f;
         }
 
+        protected override void DelEvent()
+        {
+            CombatEventManager.Instance.RemoveEventListener(CombatEventType.AddMagicWeaponHeroEntity,
+                AddMagicWeaponHeroEntity);
+            CombatEventManager.Instance.RemoveEventListener(CombatEventType.AddUseGongFa, AddUseGongFa);
+
+            StaticUpdater.Instance.RemoveLateUpdateCallBack(Update);
+        }
+
         private async void AddUseGongFa(IEventData ieveData)
         {
             AddUseGongFaEventData eventData = ieveData as AddUseGongFaEventData;
@@ -71,25 +90,16 @@ namespace Fort23.Mono
             // shengShiEventWidget.InitShengShiEventWidget(configId);
         }
 
-        private async void AddRandomEventEventData(IEventData ieveData)
-        {
-            AddRandomEventEventData eventData = ieveData as AddRandomEventEventData;
-            int configId = eventData.randomEventID;
-            ShengShiEventWidget shengShiEventWidget =
-                await UIManager.Instance.CreateGComponentForObject<ShengShiEventWidget>(ShengShiEventWidget, null,
-                    DynamicEvent,
-                    isInstance: true);
-            shengShiEventWidget.InitShengShiEventWidget(configId);
-        }
+ 
 
-        private async void GameStart(IEventData ieveData)
+        public async CTask ShowPanel()
         {
-            HeroHpWidget heroHpWidget =
+            playerHeroHpWidget =
                 await UIManager.Instance.CreateGComponentForObject<HeroHpWidget>(PlayerHpWidget, null);
-            heroHpWidget.size = 250;
-            heroHpWidget.shieldSize = 100;
-            heroHpWidget.isFollowTarget = false;
-            heroHpWidget.Init(CombatController.currActiveCombat.CombatHeroController.playerHeroEntity);
+            playerHeroHpWidget.size = 250;
+            playerHeroHpWidget.shieldSize = 100;
+            playerHeroHpWidget.isFollowTarget = false;
+            playerHeroHpWidget.Init(CombatController.currActiveCombat.CombatHeroController.playerHeroEntity);
 
             CombatHeroEntity[] allEnemy = CombatController.currActiveCombat.CombatHeroController.GetHero(true);
             for (int i = 0; i < allEnemy.Length; i++)
@@ -102,18 +112,9 @@ namespace Fort23.Mono
             }
         }
 
-        protected override void DelEvent()
-        {
-            CombatEventManager.Instance.RemoveEventListener(CombatEventType.AddRandomEvent, AddRandomEventEventData);
-            CombatEventManager.Instance.RemoveEventListener(CombatEventType.GameStart, GameStart);
-            CombatEventManager.Instance.RemoveEventListener(CombatEventType.AddMagicWeaponHeroEntity,
-                AddMagicWeaponHeroEntity);
-            StaticUpdater.Instance.RemoveLateUpdateCallBack(Update);
-        }
 
         public override void AddButtonEvent()
         {
-            bnt_shengShi.onClick.AddListener(Bnt_shengShi_onClick);
             CameraSelect.onValueChanged.AddListener(CameraSelect_onValueChanged);
             AutoUse.onValueChanged.AddListener((x) =>
             {
@@ -123,26 +124,7 @@ namespace Fort23.Mono
         }
 
 
-        private async void Bnt_shengShi_onClick()
-        {
-            UIManager.Instance.DormancyAllGComponent<ShengShiEventWidget>();
-            CombatController.currActiveCombat.CombatSenceController.StartPayShengShi(CombatController.currActiveCombat
-                .CombatHeroController.playerHeroEntity.GameObject.transform);
-            List<EventConfig> eventConfigs = EventSystemManager.Instance.UseDivinesense(1);
-            if (eventConfigs == null || eventConfigs.Count == 0)
-                return;
-            for (var i = 0; i < eventConfigs.Count; i++)
-            {
-                ShengShiEventWidget shengShiEventWidget =
-                    await UIManager.Instance.CreateGComponentForObject<ShengShiEventWidget>(ShengShiEventWidget, null,
-                        DynamicEvent,
-                        isInstance: true);
-                shengShiEventWidget.InitShengShiEventWidget(eventConfigs[i].ID);
-            }
-            //
-            // CombatController.currActiveCombat.RandomEventController.StartRandomEvent(CombatController.currActiveCombat
-            //     .CombatHeroController.playerHeroEntity.GameObject.transform);
-        }
+
 
         private void CameraSelect_onValueChanged(float value)
         {

+ 9 - 0
Assets/Scripts/GameUI/UI/CombatPanel/HeroHpWidget.cs

@@ -90,6 +90,11 @@ namespace Fort23.Mono
             HeroHpUpdateEventData heroHpUpdateEventData = iEventData as HeroHpUpdateEventData;
             if (heroHpUpdateEventData.combatHeroEntity == combatHeroEntity)
             {
+                if (string.IsNullOrEmpty(poolObjName))
+                {
+                    return;
+                }
+
                 GObjectPool.Instance.Recycle(this);
             }
         }
@@ -99,6 +104,10 @@ namespace Fort23.Mono
             HeroDieEventData heroHpUpdateEventData = iEventData as HeroDieEventData;
             if (heroHpUpdateEventData.combatHeroEntity == combatHeroEntity && combatHeroEntity.IsEnemy)
             {
+                if (string.IsNullOrEmpty(poolObjName))
+                {
+                    return;
+                }
                 GObjectPool.Instance.Recycle(this);
             }
         }

+ 6 - 3
Assets/Scripts/GameUI/UI/CombatPanel/ShengShiEventWidget.cs

@@ -8,6 +8,8 @@ namespace Fort23.Mono
     [UIBinding(prefab = "ShengShiEventWidget")]
     public partial class ShengShiEventWidget : UIComponent
     {
+        private AccountFileInfo.EventList eventList;
+
         private void Init()
         {
         }
@@ -28,14 +30,15 @@ namespace Fort23.Mono
         private void Button_onClick()
         {
             UIManager.Instance.DormancyAllGComponent<ShengShiEventWidget>();
-            EventSystemManager.Instance.TriggerEvent(randomEventConfig);
+            EventSystemManager.Instance.TriggerEvent(eventList);
         }
 
         private EventConfig randomEventConfig;
 
-        public void InitShengShiEventWidget(int id)
+        public void InitShengShiEventWidget(AccountFileInfo.EventList eventList)
         {
-            randomEventConfig = ConfigComponent.Instance.Get<EventConfig>(id);
+            this.eventList = eventList;
+            randomEventConfig = ConfigComponent.Instance.Get<EventConfig>(eventList.eventID);
             Massge.text = LanguageManager.Instance.Text(randomEventConfig.Description);
         }
     }

+ 1 - 0
Assets/Scripts/GameUI/UI/CombatPanel/ZhuanPanPanel.cs

@@ -37,6 +37,7 @@ namespace Fort23.Mono
                 widget.transform.anchoredPosition = new Vector2((float)x, (float)y);
                 widget.ShowWidget(index);
             }
+            ExercisesAlter(null);
         }
 
         private void Init()

+ 29 - 5
Assets/Scripts/GameUI/UI/MainPanel/MainPanel.cs

@@ -1,6 +1,8 @@
 using System.Collections.Generic;
 using Excel2Json;
 using Fort23.Core;
+using Fort23.UTool;
+using GameLogic.Combat;
 using GameLogic.Combat.CombatTool;
 using UnityEngine;
 
@@ -16,6 +18,12 @@ namespace Fort23.Mono
         protected override void AddEvent()
         {
             EventManager.Instance.AddEventListener(CustomEventType.DivineSensePointChange, DivineSensePointChange);
+            EventManager.Instance.AddEventListener(CustomEventType.CompleteEvent, CompleteEvent);
+        }
+
+        private void CompleteEvent(IEventData e)
+        {
+            CreatShengShiEvent();
         }
 
         private void DivineSensePointChange(IEventData e)
@@ -26,6 +34,7 @@ namespace Fort23.Mono
         protected override void DelEvent()
         {
             EventManager.Instance.RemoveEventListener(CustomEventType.DivineSensePointChange, DivineSensePointChange);
+            EventManager.Instance.RemoveEventListener(CustomEventType.CompleteEvent, CompleteEvent);
         }
 
         public override void AddButtonEvent()
@@ -36,6 +45,7 @@ namespace Fort23.Mono
         public override CTask<bool> AsyncInit(object[] uiData)
         {
             Text_divineSensePoint.text = $"{AccountFileInfo.Instance.playerData.divineSensePoint}/{PlayerManager.Instance.gameConstantConfig.DetectEventCount}";
+            CreatShengShiEvent();
             return base.AsyncInit(uiData);
         }
 
@@ -49,21 +59,31 @@ namespace Fort23.Mono
                 return;
             }
 
-            UIManager.Instance.DormancyAllGComponent<ShengShiEventWidget>();
+          
             CombatController.currActiveCombat.CombatSenceController.StartPayShengShi(CombatController.currActiveCombat
                 .CombatHeroController.playerHeroEntity.GameObject.transform);
-            List<EventConfig> eventConfigs = EventSystemManager.Instance.UseDivinesense(1);
-            if (eventConfigs == null || eventConfigs.Count == 0)
+            List<AccountFileInfo.EventList> eventLists = EventSystemManager.Instance.UseDivinesense(1);
+            if (eventLists == null || eventLists.Count == 0)
                 return;
-            for (var i = 0; i < eventConfigs.Count; i++)
+      
+            AccountFileInfo.Instance.playerData.eventList.AddRange(eventLists);
+            AccountFileInfo.Instance.SavePlayerData();
+            CreatShengShiEvent();
+        }
+
+        public async void CreatShengShiEvent()
+        {
+            UIManager.Instance.DormancyAllGComponent<ShengShiEventWidget>();
+            for (var i = 0; i < AccountFileInfo.Instance.playerData.eventList.Count; i++)
             {
                 ShengShiEventWidget shengShiEventWidget =
                     await UIManager.Instance.CreateGComponentForObject<ShengShiEventWidget>(ShengShiEventWidget, null,
                         DynamicEvent,
                         isInstance: true);
-                shengShiEventWidget.InitShengShiEventWidget(eventConfigs[i].ID);
+                shengShiEventWidget.InitShengShiEventWidget(AccountFileInfo.Instance.playerData.eventList[i]);
             }
         }
+        
 
         [CustomMethod(CustomMethodType.Update)]
         public void Update()
@@ -71,6 +91,10 @@ namespace Fort23.Mono
             if (Input.GetKeyDown(KeyCode.Y))
             {
                 EventSystemManager.Instance.DetectRandomEvents();
+                // CombatDrive.Instance.LoadLevelBattleCombat(100001, delegate(bool isWin)
+                // {
+                //     LogTool.Log("战斗完成"+isWin);
+                // });
             }
         }
 

文件差异内容过多而无法显示
+ 446 - 166
UserSettings/Layouts/default-2022.dwlt


部分文件因为文件数量过多而无法显示