少年修仙传客户端代码仓库
client_Wu Xijin
2019-05-09 080541104565b8f06568430353428f4e72d52723
Merge branch 'master' into SkyTower

# Conflicts:
# Fight/Stage/StageLoadProcessor.cs
22个文件已修改
1784 ■■■■■ 已修改文件
Core/GameEngine/Model/Config/RealmConfig.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/RealmConfig.cs.meta 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0406_tagNPCAppear.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0408_tagPlayerSummonNPCAppear.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0434_tagAreaPlayerAppearEx.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0435_tagPetAppear.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_NpcFunc.cs 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/MapEditor/Game/ClientSceneManager.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/StageLoad.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/StageLoadProcessor.cs 1294 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Alchemy/AlchemyModel.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Alchemy/AlchemyResultWin.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipTrain/EquipTrain.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipTrain/EquipTrainModel.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipTrain/EquipTrainWin.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/DialogueDuidanceWin.cs 309 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/TaskModel.cs 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/ReikiRootModel.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/ReikiRootPointBehaviour.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/ReikiRootResetWin.cs 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/ReikiRootWin.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/UIHelper.cs 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/RealmConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           Fish
//    [  Date ]:           Wednesday, March 20, 2019
//    [  Date ]:           Thursday, May 09, 2019
//--------------------------------------------------------
using System.Collections.Generic;
@@ -18,6 +18,7 @@
    public readonly int NeedLV;
    public readonly int NeedGood;
    public readonly int NeedNum;
    public readonly int[] NeedEquip;
    public readonly int[] AddAttrType;
    public readonly int[] AddAttrNum;
    public readonly int BossID;
@@ -51,39 +52,46 @@
            int.TryParse(tables[4],out NeedNum); 
            string[] AddAttrTypeStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            string[] NeedEquipStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            NeedEquip = new int[NeedEquipStringArray.Length];
            for (int i=0;i<NeedEquipStringArray.Length;i++)
            {
                 int.TryParse(NeedEquipStringArray[i],out NeedEquip[i]);
            }
            string[] AddAttrTypeStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            AddAttrType = new int[AddAttrTypeStringArray.Length];
            for (int i=0;i<AddAttrTypeStringArray.Length;i++)
            {
                 int.TryParse(AddAttrTypeStringArray[i],out AddAttrType[i]);
            }
            string[] AddAttrNumStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            string[] AddAttrNumStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            AddAttrNum = new int[AddAttrNumStringArray.Length];
            for (int i=0;i<AddAttrNumStringArray.Length;i++)
            {
                 int.TryParse(AddAttrNumStringArray[i],out AddAttrNum[i]);
            }
            int.TryParse(tables[7],out BossID);
            int.TryParse(tables[8],out BossID);
            long.TryParse(tables[8],out expRate);
            long.TryParse(tables[9],out expRate);
            long.TryParse(tables[9],out expLimit);
            long.TryParse(tables[10],out expLimit);
            Img = tables[10];
            Img = tables[11];
            int.TryParse(tables[11],out Quality);
            int.TryParse(tables[12],out Quality);
            int.TryParse(tables[12],out FightPower);
            int.TryParse(tables[13],out FightPower);
            equipNameIcon = tables[13];
            equipNameIcon = tables[14];
            equips = tables[14];
            equips = tables[15];
            int.TryParse(tables[15],out effectId);
            int.TryParse(tables[16],out effectId);
            int.TryParse(tables[16],out requireIconEffect);
            int.TryParse(tables[17],out requireIconEffect);
        }
        catch (Exception ex)
        {
Core/GameEngine/Model/Config/RealmConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: d49ca04ff4a91bc4fb645c417f9ef0b3
timeCreated: 1553061533
timeCreated: 1557382273
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0406_tagNPCAppear.cs
@@ -146,7 +146,7 @@
                    break;
            }
            if (StageLoad.Instance.isLoading)
            if (StageLoad.Instance.isLoadingScene)
            {
                GAMgr.Instance.AddReJustPosActor(_actor);
            }
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0408_tagPlayerSummonNPCAppear.cs
@@ -45,7 +45,7 @@
                   vNetData.NPCID, _group, vNetData);
        }
        if (StageLoad.Instance.isLoading)
        if (StageLoad.Instance.isLoadingScene)
        {
            GAMgr.Instance.AddReJustPosActor(_actor);
        }
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0434_tagAreaPlayerAppearEx.cs
@@ -36,7 +36,7 @@
        _player = GAMgr.Instance.RequestPlayer<GA_Player>(vNetData.PlayerID, E_ActorGroup.Player, vNetData);
        if (StageLoad.Instance.isLoading)
        if (StageLoad.Instance.isLoadingScene)
        {
            GAMgr.Instance.AddReJustPosActor(_player);
        }
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0435_tagPetAppear.cs
@@ -36,7 +36,7 @@
        _pet = GAMgr.Instance.RequestNPCFight<GA_Pet>(vNetData.PetID, vNetData.NPCID, _group, vNetData);
        if (StageLoad.Instance.isLoading)
        if (StageLoad.Instance.isLoadingScene)
        {
            GAMgr.Instance.AddReJustPosActor(_pet);
        }
Fight/GameActor/GA_NpcFunc.cs
@@ -59,7 +59,6 @@
        GAStaticDefine.NpcID2ServerInstID[NpcConfig.NPCID] = ServerInstID;
        TaskModel.Event_TaskResponse += OnTaskRefresh;
        bool _needHide = (NpcConfig.Show == 0);
        TaskModel _model = ModelCenter.Instance.GetModel<TaskModel>();
Fight/Stage/MapEditor/Game/ClientSceneManager.cs
@@ -708,7 +708,7 @@
            yield break;
        }
        while (StageLoad.Instance.isLoading)
        while (StageLoad.Instance.isLoadingScene)
        {
            yield return null;
        }
Fight/Stage/StageLoad.cs
@@ -7,8 +7,10 @@
public class StageLoad : SingletonMonobehaviour<StageLoad>
{
    StageLoadProcessor stageLoadProcessor;
    public float progress {
        get {
    public float progress
    {
        get
        {
            if (stageLoadProcessor != null)
            {
                return stageLoadProcessor.progress;
@@ -21,13 +23,16 @@
    }
    Stage m_CurrentStage;
    public Stage currentStage {
    public Stage currentStage
    {
        get { return m_CurrentStage; }
        set { m_CurrentStage = value; }
    }
    public Stage.E_StageType stageType {
        get {
    public Stage.E_StageType stageType
    {
        get
        {
            return (currentStage != null && currentStage is DungeonStage) ? Stage.E_StageType.Dungeon : Stage.E_StageType.MainCity;
        }
    }
@@ -43,6 +48,7 @@
    float loadStartTime = 0f;
    public bool isLoading { get; private set; }
    public bool isLoadingScene;
    public int mapIdRecord { get; private set; }
    public int lineIdRecord { get; private set; }
@@ -146,16 +152,16 @@
        WindowCenter.Instance.Close<MainInterfaceWin>();
        loadStartTime = Time.time;
        isLoading = true;
        isLoadingScene = true;
    }
    public void ReportComplete(int mapId, int lineId ,bool record)
    public void ReportComplete(int mapId, int lineId, bool record)
    {
        if (record)
        {
            mapIdRecord = mapId;
            lineIdRecord = lineId;
        }
        isLoading = false;
        StageLoadTimeOutCatcher.Stop();
Fight/Stage/StageLoadProcessor.cs
@@ -1,651 +1,651 @@
using Snxxz.UI;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class StageLoadProcessor : MonoBehaviour
{
    float progressBuf = 0.1f;
    public float progress { get; private set; }
    StageLoadTask currentTask = null;
    Queue<StageLoadTask> tasks = new Queue<StageLoadTask>();
    public void Begin(Queue<StageLoadTask> tasks)
    {
        this.tasks = tasks;
        var totalWeight = 0f;
        foreach (var task in tasks)
        {
            totalWeight += task.exceptedWeight;
        }
        foreach (var task in tasks)
        {
            task.weight = task.exceptedWeight / totalWeight;
        }
    }
    public void Complete(int mapId, int lineId, bool record)
    {
        StageLoad.Instance.ReportComplete(mapId, lineId, record);
    }
    private void Update()
    {
        if (currentTask == null)
        {
            if (tasks.Count > 0)
            {
                currentTask = tasks.Dequeue();
                currentTask.Begin();
            }
        }
        if (currentTask != null)
        {
            currentTask.Update();
            if (!currentTask.done)
            {
                progress = Mathf.Clamp01(progressBuf + currentTask.weight * currentTask.progress);
            }
            else
            {
                progressBuf += currentTask.weight;
                currentTask.End();
                if (tasks.Count == 0)
using Snxxz.UI;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class StageLoadProcessor : MonoBehaviour
{
    float progressBuf = 0.1f;
    public float progress { get; private set; }
    StageLoadTask currentTask = null;
    Queue<StageLoadTask> tasks = new Queue<StageLoadTask>();
    public void Begin(Queue<StageLoadTask> tasks)
    {
        this.tasks = tasks;
        var totalWeight = 0f;
        foreach (var task in tasks)
        {
            totalWeight += task.exceptedWeight;
        }
        foreach (var task in tasks)
        {
            task.weight = task.exceptedWeight / totalWeight;
        }
    }
    public void Complete(int mapId, int lineId, bool record)
    {
        StageLoad.Instance.ReportComplete(mapId, lineId, record);
    }
    private void Update()
    {
        if (currentTask == null)
        {
            if (tasks.Count > 0)
            {
                currentTask = tasks.Dequeue();
                currentTask.Begin();
            }
        }
        if (currentTask != null)
        {
            currentTask.Update();
            if (!currentTask.done)
            {
                progress = Mathf.Clamp01(progressBuf + currentTask.weight * currentTask.progress);
            }
            else
            {
                progressBuf += currentTask.weight;
                currentTask.End();
                if (tasks.Count == 0)
                {
                    Complete(currentTask.command.toMapId, currentTask.command.toLineId, currentTask.command.needLoadResource);
                }
                currentTask = null;
            }
        }
    }
    public abstract class StageLoadTask
    {
        public float timer { get; protected set; }
        public float duration { get; protected set; }
        public bool done { get; protected set; }
        public float progress { get; protected set; }
        public float exceptedWeight { get; protected set; }
        public float weight { get; set; }
        public readonly StageLoad.StageLoadCommand command;
        public StageLoadTask(StageLoad.StageLoadCommand command)
        {
            this.command = command;
        }
        public abstract void Begin();
        public abstract void Update();
        public abstract void End();
    }
    public class WaitConfigInitedTask : StageLoadTask
    {
        public WaitConfigInitedTask(StageLoad.StageLoadCommand command) : base(command)
        {
        }
        public override void Begin()
        {
            exceptedWeight = 0.2f;
            done = ConfigInitiator.done;
        }
        public override void End()
        {
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            done = ConfigInitiator.done;
        }
    }
    public class PreProcessTask : StageLoadTask
    {
        public PreProcessTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.1f;
        }
        public override void Begin()
        {
            SystemSetting.Instance.LetFPSUnLimit();
            Application.backgroundLoadingPriority = ThreadPriority.High;
            StageLoad.Instance.BroadcastStageLoadStartEvent(command.fromMapId);
            try
            {
                switch (command.toMapId)
                {
                    case 1:
                    case 2:
                    case 3:
                        if (PlayerDatas.Instance.hero != null)
                        {
                            PlayerDatas.Instance.hero.Behaviour.StopHandupAI(true);
                            GAMgr.Instance.ServerDie(PlayerDatas.Instance.baseData.PlayerID);
                            GAMgr.Instance.Release(PlayerDatas.Instance.hero);
                            PlayerDatas.Instance.hero = null;
                        }
                        break;
                    default:
                        break;
                }
            }
            catch (System.Exception ex)
            {
                Debug.LogError(ex);
            }
            try
            {
                //为什么在这个地方要调用两次关闭其他窗口的接口呢,这个水就深了。
                //因为有些界面被关闭的时候,会去打开主界面,所以,还得再关闭一次关闭其他窗口的界面,防止主界面被意外开启。
                WindowCenter.Instance.asyncLoad.StopAllTasks();
                switch (command.toMapId)
                {
                    case 2:
                    case 3:
                        WindowCenter.Instance.DestoryWinsByStage(WindowCenter.WindowStage.Login);
                        WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
                        if (!WindowCenter.Instance.IsOpen<LaunchBackGroundWin>())
                        {
                            WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
                        }
                        break;
                    case 1:
                        WindowCenter.Instance.DestoryWinsByStage(WindowCenter.WindowStage.Launch);
                        WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
                        if (!WindowCenter.Instance.IsOpen<LaunchBackGroundWin>())
                        {
                            WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
                        }
                        break;
                    default:
                        WindowCenter.Instance.DestoryWinsByStage(WindowCenter.WindowStage.SelectRole);
                        WindowCenter.Instance.CloseOthers<LoadingWin>();
                        if (!WindowCenter.Instance.IsOpen<LoadingWin>())
                        {
                            var dataMapId = MapUtility.GetDataMapId(command.toMapId);
                            var lineId = MapUtility.GetLineId(command.toMapId, command.toLineId);
                            var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                            LoadingWin.targetMapResId = config.ID;
                            WindowCenter.Instance.Open<LoadingWin>(true);
                        }
                        break;
                }
            }
            catch (System.Exception ex)
            {
                Debug.LogError(ex);
                ExceptionCatcher.ReportException("场景加载 Step3", ex);
            }
            done = true;
        }
        public override void End()
        {
        }
        public override void Update()
        {
        }
    }
    public class LoadEmptyTask : StageLoadTask
    {
        public LoadEmptyTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.2f;
        }
        public override void Begin()
        {
            duration = 0.2f;
            SceneManager.LoadScene("Empty");
        }
        public override void End()
        {
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (timer > duration)
            {
                done = true;
                progress = timer / duration;
            }
        }
    }
    public class UnLoadAndGCTask : StageLoadTask
    {
        AsyncOperation unloadUnUsedOperation;
        public UnLoadAndGCTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.2f;
        }
        public override void Begin()
        {
            if (StageLoad.Instance.currentStage != null)
            {
                StageLoad.Instance.currentStage.UnInitialize();
            }
            unloadUnUsedOperation = Resources.UnloadUnusedAssets();
            if (command.refreshPlayerDatas)
            {
                var sendInfo = new CA108_tagCMRefreshMainServerRole();
                GameNetSystem.Instance.SendInfo(sendInfo);
            }
        }
        public override void End()
        {
            if (!AssetSource.sceneFromEditor)
            {
                AssetBundleUtility.Instance.UnloadAssetBundle("maps/map000_xsdt", true, false);
                var lastMapId = command.fromMapId;
                var lastLineId = command.fromLineId;
                var assetBundleName = GetAssetBundleNameByMapId(lastMapId, lastLineId);
                if (!string.IsNullOrEmpty(assetBundleName))
                {
                    AssetBundleUtility.Instance.UnloadAssetBundle(assetBundleName, true, false);
                }
            }
            GC.Collect();
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (unloadUnUsedOperation != null)
            {
                done = unloadUnUsedOperation.isDone;
                progress = unloadUnUsedOperation.progress;
            }
            else
            {
                done = true;
                progress = 1f;
            }
        }
    }
    public class LoadNewSceneTask : StageLoadTask
    {
        AsyncOperation operation;
        public LoadNewSceneTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.4f;
        }
        public override void Begin()
        {
            var mapId = command.toMapId;
            var lineId = command.toLineId;
            if (!AssetSource.sceneFromEditor)
            {
                var assetBundleName = GetAssetBundleNameByMapId(mapId, lineId);
                AssetBundleUtility.Instance.Sync_LoadAll(assetBundleName);
            }
            switch (command.toMapId)
            {
                case 1:
                    operation = SceneManager.LoadSceneAsync("Level_Login");
                    break;
                case 2:
                case 3:
                    operation = SceneManager.LoadSceneAsync("CreateRole_001");
                    break;
                default:
                    var dataMapId = MapUtility.GetDataMapId(mapId);
                    var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                    operation = SceneManager.LoadSceneAsync(config.MapResources);
                    break;
            }
            WindowCenter.Instance.asyncLoad.StopAllTasks();
            switch (command.toMapId)
            {
                case 1:
                case 2:
                case 3:
                    WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
                    break;
                default:
                    WindowCenter.Instance.CloseOthers<LoadingWin>();
                    break;
            }
        }
        public override void End()
        {
            var mapId = command.toMapId;
            var lineId = command.toLineId;
            var levelName = string.Empty;
            switch (mapId)
            {
                case 1:
                    levelName = "__Stage_Level_Login_";
                    break;
                case 2:
                case 3:
                    levelName = "__Stage_CreateRole_001_";
                    break;
                default:
                    try
                    {
                        StageLoad.Instance.InitHero();
                    }
                    catch (Exception ex)
                    {
                        ExceptionCatcher.ReportException("场景加载 InitHero 执行到: " + StageLoad.Instance.initHeroStep, ex);
                    }
                    var dataMapId = MapUtility.GetDataMapId(mapId);
                    var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                    levelName = string.Format("__Stage_{0}_", config.MapResources);
                    break;
            }
            var stageGameObject = new GameObject(levelName);
            Stage stage;
            switch (mapId)
            {
                case 1:
                    stage = stageGameObject.AddComponent<LoginStage>();
                    break;
                case 2:
                    stage = stageGameObject.AddComponent<CreateRoleStage>();
                    break;
                case 3:
                    stage = stageGameObject.AddComponent<SelectRoleStage>();
                    break;
                case ClientCrossServerOneVsOne.mapId:
                    stage = stageGameObject.AddComponent<ClientCrossServerOneVsOneStage>();
                    break;
                case 31250:
                    stage = stageGameObject.AddComponent<GuardDungeonStage>();
                    break;
                case RuneTowerModel.RUNETOWER_MAPID:
                    stage = stageGameObject.AddComponent<RuneTowerDungeonStage>();
                    break;
                case SkyTowerModel.DATA_MAPID:
                    stage = stageGameObject.AddComponent<SkyTowerDungeonStage>();
                    break;
                case DemonJarModel.DEMONJAR_SINGLEMAPID:
                    stage = stageGameObject.AddComponent<FakeDemonJarDungeonStage>();
                    break;
                case HazyDemonKingModel.Client_MapID:
                    stage = stageGameObject.AddComponent<ClientHazyDemonKingStage>();
                    break;
                case HazyGrassModel.Client_FairyGrassMapID:
                case HazyGrassModel.Client_ReikiGrassMapID:
                    stage = stageGameObject.AddComponent<ClientHazyGrassStage>();
                }
                currentTask = null;
            }
        }
    }
    public abstract class StageLoadTask
    {
        public float timer { get; protected set; }
        public float duration { get; protected set; }
        public bool done { get; protected set; }
        public float progress { get; protected set; }
        public float exceptedWeight { get; protected set; }
        public float weight { get; set; }
        public readonly StageLoad.StageLoadCommand command;
        public StageLoadTask(StageLoad.StageLoadCommand command)
        {
            this.command = command;
        }
        public abstract void Begin();
        public abstract void Update();
        public abstract void End();
    }
    public class WaitConfigInitedTask : StageLoadTask
    {
        public WaitConfigInitedTask(StageLoad.StageLoadCommand command) : base(command)
        {
        }
        public override void Begin()
        {
            exceptedWeight = 0.2f;
            done = ConfigInitiator.done;
        }
        public override void End()
        {
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            done = ConfigInitiator.done;
        }
    }
    public class PreProcessTask : StageLoadTask
    {
        public PreProcessTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.1f;
        }
        public override void Begin()
        {
            SystemSetting.Instance.LetFPSUnLimit();
            Application.backgroundLoadingPriority = ThreadPriority.High;
            StageLoad.Instance.BroadcastStageLoadStartEvent(command.fromMapId);
            try
            {
                switch (command.toMapId)
                {
                    case 1:
                    case 2:
                    case 3:
                        if (PlayerDatas.Instance.hero != null)
                        {
                            PlayerDatas.Instance.hero.Behaviour.StopHandupAI(true);
                            GAMgr.Instance.ServerDie(PlayerDatas.Instance.baseData.PlayerID);
                            GAMgr.Instance.Release(PlayerDatas.Instance.hero);
                            PlayerDatas.Instance.hero = null;
                        }
                        break;
                    default:
                        break;
                }
            }
            catch (System.Exception ex)
            {
                Debug.LogError(ex);
            }
            try
            {
                //为什么在这个地方要调用两次关闭其他窗口的接口呢,这个水就深了。
                //因为有些界面被关闭的时候,会去打开主界面,所以,还得再关闭一次关闭其他窗口的界面,防止主界面被意外开启。
                WindowCenter.Instance.asyncLoad.StopAllTasks();
                switch (command.toMapId)
                {
                    case 2:
                    case 3:
                        WindowCenter.Instance.DestoryWinsByStage(WindowCenter.WindowStage.Login);
                        WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
                        if (!WindowCenter.Instance.IsOpen<LaunchBackGroundWin>())
                        {
                            WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
                        }
                        break;
                    case 1:
                        WindowCenter.Instance.DestoryWinsByStage(WindowCenter.WindowStage.Launch);
                        WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
                        if (!WindowCenter.Instance.IsOpen<LaunchBackGroundWin>())
                        {
                            WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
                        }
                        break;
                    default:
                        WindowCenter.Instance.DestoryWinsByStage(WindowCenter.WindowStage.SelectRole);
                        WindowCenter.Instance.CloseOthers<LoadingWin>();
                        if (!WindowCenter.Instance.IsOpen<LoadingWin>())
                        {
                            var dataMapId = MapUtility.GetDataMapId(command.toMapId);
                            var lineId = MapUtility.GetLineId(command.toMapId, command.toLineId);
                            var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                            LoadingWin.targetMapResId = config.ID;
                            WindowCenter.Instance.Open<LoadingWin>(true);
                        }
                        break;
                }
            }
            catch (System.Exception ex)
            {
                Debug.LogError(ex);
                ExceptionCatcher.ReportException("场景加载 Step3", ex);
            }
            done = true;
        }
        public override void End()
        {
        }
        public override void Update()
        {
        }
    }
    public class LoadEmptyTask : StageLoadTask
    {
        public LoadEmptyTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.2f;
        }
        public override void Begin()
        {
            duration = 0.2f;
            SceneManager.LoadScene("Empty");
        }
        public override void End()
        {
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (timer > duration)
            {
                done = true;
                progress = timer / duration;
            }
        }
    }
    public class UnLoadAndGCTask : StageLoadTask
    {
        AsyncOperation unloadUnUsedOperation;
        public UnLoadAndGCTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.2f;
        }
        public override void Begin()
        {
            if (StageLoad.Instance.currentStage != null)
            {
                StageLoad.Instance.currentStage.UnInitialize();
            }
            unloadUnUsedOperation = Resources.UnloadUnusedAssets();
            if (command.refreshPlayerDatas)
            {
                var sendInfo = new CA108_tagCMRefreshMainServerRole();
                GameNetSystem.Instance.SendInfo(sendInfo);
            }
        }
        public override void End()
        {
            if (!AssetSource.sceneFromEditor)
            {
                AssetBundleUtility.Instance.UnloadAssetBundle("maps/map000_xsdt", true, false);
                var lastMapId = command.fromMapId;
                var lastLineId = command.fromLineId;
                var assetBundleName = GetAssetBundleNameByMapId(lastMapId, lastLineId);
                if (!string.IsNullOrEmpty(assetBundleName))
                {
                    AssetBundleUtility.Instance.UnloadAssetBundle(assetBundleName, true, false);
                }
            }
            GC.Collect();
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (unloadUnUsedOperation != null)
            {
                done = unloadUnUsedOperation.isDone;
                progress = unloadUnUsedOperation.progress;
            }
            else
            {
                done = true;
                progress = 1f;
            }
        }
    }
    public class LoadNewSceneTask : StageLoadTask
    {
        AsyncOperation operation;
        public LoadNewSceneTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.4f;
        }
        public override void Begin()
        {
            var mapId = command.toMapId;
            var lineId = command.toLineId;
            if (!AssetSource.sceneFromEditor)
            {
                var assetBundleName = GetAssetBundleNameByMapId(mapId, lineId);
                AssetBundleUtility.Instance.Sync_LoadAll(assetBundleName);
            }
            switch (command.toMapId)
            {
                case 1:
                    operation = SceneManager.LoadSceneAsync("Level_Login");
                    break;
                case 2:
                case 3:
                    operation = SceneManager.LoadSceneAsync("CreateRole_001");
                    break;
                default:
                    var dataMapId = MapUtility.GetDataMapId(mapId);
                    var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                    operation = SceneManager.LoadSceneAsync(config.MapResources);
                    break;
            }
            WindowCenter.Instance.asyncLoad.StopAllTasks();
            switch (command.toMapId)
            {
                case 1:
                case 2:
                case 3:
                    WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
                    break;
                default:
                    WindowCenter.Instance.CloseOthers<LoadingWin>();
                    break;
            }
        }
        public override void End()
        {
            var mapId = command.toMapId;
            var lineId = command.toLineId;
            var levelName = string.Empty;
            switch (mapId)
            {
                case 1:
                    levelName = "__Stage_Level_Login_";
                    break;
                case 2:
                case 3:
                    levelName = "__Stage_CreateRole_001_";
                    break;
                default:
                    try
                    {
                        StageLoad.Instance.InitHero();
                    }
                    catch (Exception ex)
                    {
                        ExceptionCatcher.ReportException("场景加载 InitHero 执行到: " + StageLoad.Instance.initHeroStep, ex);
                    }
                    var dataMapId = MapUtility.GetDataMapId(mapId);
                    var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                    levelName = string.Format("__Stage_{0}_", config.MapResources);
                    break;
            }
            var stageGameObject = new GameObject(levelName);
            Stage stage;
            switch (mapId)
            {
                case 1:
                    stage = stageGameObject.AddComponent<LoginStage>();
                    break;
                case 2:
                    stage = stageGameObject.AddComponent<CreateRoleStage>();
                    break;
                case 3:
                    stage = stageGameObject.AddComponent<SelectRoleStage>();
                    break;
                case ClientCrossServerOneVsOne.mapId:
                    stage = stageGameObject.AddComponent<ClientCrossServerOneVsOneStage>();
                    break;
                case 31250:
                    stage = stageGameObject.AddComponent<GuardDungeonStage>();
                    break;
                case RuneTowerModel.RUNETOWER_MAPID:
                    stage = stageGameObject.AddComponent<RuneTowerDungeonStage>();
                    break;
                case SkyTowerModel.DATA_MAPID:
                    stage = stageGameObject.AddComponent<SkyTowerDungeonStage>();
                    break;
                case DemonJarModel.DEMONJAR_SINGLEMAPID:
                    stage = stageGameObject.AddComponent<FakeDemonJarDungeonStage>();
                    break;
                case HazyDemonKingModel.Client_MapID:
                    stage = stageGameObject.AddComponent<ClientHazyDemonKingStage>();
                    break;
                case HazyGrassModel.Client_FairyGrassMapID:
                case HazyGrassModel.Client_ReikiGrassMapID:
                    stage = stageGameObject.AddComponent<ClientHazyGrassStage>();
                    break;
                case ClientTreasureDungeon.Client_DataMap:
                    stage = stageGameObject.AddComponent<ClientTreasureDungeonStage>();
                    break;
                default:
                    stage = stageGameObject.AddComponent<DungeonStage>();
                    break;
            }
            stage.mapId = mapId;
            StageLoad.Instance.currentStage = stage;
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (operation != null)
            {
                done = operation.isDone;
                progress = operation.progress;
            }
            else
            {
                done = true;
                progress = 1f;
            }
        }
    }
    public class Wait0109Task : StageLoadTask
    {
        public Wait0109Task(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.1f;
        }
        public override void Begin()
        {
            duration = 1f;
        }
        public override void End()
        {
            var mapOk = new C0107_tagCInitMapOK();
            mapOk.MapID = (ushort)command.toMapId;
            mapOk.Type = 0;
            StageLoadTimeOutCatcher.RecordProtocol(command.serverType, "0107", DateTime.Now);
            switch (command.serverType)
            {
                case ServerType.Main:
                    GameNetSystem.Instance.SendInfo(mapOk);
                    break;
                case ServerType.CrossSever:
                    GameNetSystem.Instance.SendToCrossServer(mapOk);
                    break;
                default:
                    break;
            }
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (!command.serverFlag0109)
            {
                done = false;
                progress = timer / duration;
            }
            else
            {
                done = true;
                progress = 1f;
            }
        }
    }
    public class WaitLoginCompleteTask : StageLoadTask
    {
        public WaitLoginCompleteTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.2f;
        }
        public override void Begin()
        {
            duration = 2f;
        }
        public override void End()
        {
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (DTC0403_tagPlayerLoginLoadOK.neverLoginOk)
            {
                done = false;
                progress = timer / duration;
            }
            else
            {
                done = true;
                progress = 1f;
            }
        }
    }
    public class PostProcessTask : StageLoadTask
    {
        public PostProcessTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.1f;
        }
        public override void Begin()
        {
            StageLoad.Instance.BroadcastStageLoadEndEvent();
            WindowCenter.Instance.Close<LoadingWin>();
            SystemSetting.Instance.SetGameFps(SystemSetting.Instance.GetGameFps());
            done = true;
        }
        public override void End()
        {
            Application.backgroundLoadingPriority = ThreadPriority.BelowNormal;
            GAMgr.Instance.DoReAdjustPos();
            GAMgr.Instance.ClearReJustActor();
            DebugEx.LogFormat("StageLoad => Load Scene : {0} Finished.", command.toMapId);
        }
        public override void Update()
        {
        }
    }
    public class WaitSecondsTask : StageLoadTask
    {
        public WaitSecondsTask(StageLoad.StageLoadCommand command, float seconds) : base(command)
        {
            duration = seconds;
        }
        public override void Begin()
        {
        }
        public override void End()
        {
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (timer > duration)
            {
                done = true;
            }
            else
            {
                done = false;
                progress = timer / duration;
            }
        }
    }
    public class ReturnToNoviceVillageTask : StageLoadTask
    {
        public ReturnToNoviceVillageTask(StageLoad.StageLoadCommand command) : base(command)
        {
        }
        public override void Begin()
        {
            if (CrossServerUtility.IsCrossServer())
            {
                var sendInfo = new CC003_tagCGForceQuitCrossState();
                GameNetSystem.Instance.SendInfo(sendInfo);
            }
            else
            {
                var mapConfig = MapConfig.Get(PlayerDatas.Instance.baseData.MapID);
                if (mapConfig.MapFBType == (int)MapType.OpenCountry)
                {
                    var sjzMapConfig = MapConfig.Get(10010);
                    var position = new Vector3(sjzMapConfig.BornPoints[0].x, 0, sjzMapConfig.BornPoints[0].y);
                    MapTransferUtility.Send_WorldTransfer(10010, position, MapTransferType.WorldTransport, 255, 0);
                }
                else
                {
                    ModelCenter.Instance.GetModel<DungeonModel>().ExitCurrentDungeon();
                }
            }
            done = true;
        }
        public override void End()
        {
        }
        public override void Update()
        {
        }
    }
    private static string GetAssetBundleNameByMapId(int mapId, int lineId)
    {
        switch (mapId)
        {
            case 0:
                return string.Empty;
            case 1:
                return "maps/level_login";
            case 2:
            case 3:
                return "maps/createrole_001";
            default:
                var dataMapId = MapUtility.GetDataMapId(mapId);
                var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                if (config != null)
                {
                    return StringUtility.Contact("maps/", config.MapResources);
                }
                else
                {
                    return string.Empty;
                }
        }
    }
}
                    stage = stageGameObject.AddComponent<ClientTreasureDungeonStage>();
                    break;
                default:
                    stage = stageGameObject.AddComponent<DungeonStage>();
                    break;
            }
            stage.mapId = mapId;
            StageLoad.Instance.currentStage = stage;
            StageLoad.Instance.isLoadingScene = false;
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (operation != null)
            {
                done = operation.isDone;
                progress = operation.progress;
            }
            else
            {
                done = true;
                progress = 1f;
            }
        }
    }
    public class Wait0109Task : StageLoadTask
    {
        public Wait0109Task(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.1f;
        }
        public override void Begin()
        {
            duration = 1f;
        }
        public override void End()
        {
            var mapOk = new C0107_tagCInitMapOK();
            mapOk.MapID = (ushort)command.toMapId;
            mapOk.Type = 0;
            StageLoadTimeOutCatcher.RecordProtocol(command.serverType, "0107", DateTime.Now);
            switch (command.serverType)
            {
                case ServerType.Main:
                    GameNetSystem.Instance.SendInfo(mapOk);
                    break;
                case ServerType.CrossSever:
                    GameNetSystem.Instance.SendToCrossServer(mapOk);
                    break;
                default:
                    break;
            }
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (!command.serverFlag0109)
            {
                done = false;
                progress = timer / duration;
            }
            else
            {
                done = true;
                progress = 1f;
            }
        }
    }
    public class WaitLoginCompleteTask : StageLoadTask
    {
        public WaitLoginCompleteTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.2f;
        }
        public override void Begin()
        {
            duration = 2f;
        }
        public override void End()
        {
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (DTC0403_tagPlayerLoginLoadOK.neverLoginOk)
            {
                done = false;
                progress = timer / duration;
            }
            else
            {
                done = true;
                progress = 1f;
            }
        }
    }
    public class PostProcessTask : StageLoadTask
    {
        public PostProcessTask(StageLoad.StageLoadCommand command) : base(command)
        {
            exceptedWeight = 0.1f;
        }
        public override void Begin()
        {
            StageLoad.Instance.BroadcastStageLoadEndEvent();
            WindowCenter.Instance.Close<LoadingWin>();
            SystemSetting.Instance.SetGameFps(SystemSetting.Instance.GetGameFps());
            done = true;
        }
        public override void End()
        {
            Application.backgroundLoadingPriority = ThreadPriority.BelowNormal;
            GAMgr.Instance.DoReAdjustPos();
            GAMgr.Instance.ClearReJustActor();
            DebugEx.LogFormat("StageLoad => Load Scene : {0} Finished.", command.toMapId);
        }
        public override void Update()
        {
        }
    }
    public class WaitSecondsTask : StageLoadTask
    {
        public WaitSecondsTask(StageLoad.StageLoadCommand command, float seconds) : base(command)
        {
            duration = seconds;
        }
        public override void Begin()
        {
        }
        public override void End()
        {
        }
        public override void Update()
        {
            timer += Time.deltaTime;
            if (timer > duration)
            {
                done = true;
            }
            else
            {
                done = false;
                progress = timer / duration;
            }
        }
    }
    public class ReturnToNoviceVillageTask : StageLoadTask
    {
        public ReturnToNoviceVillageTask(StageLoad.StageLoadCommand command) : base(command)
        {
        }
        public override void Begin()
        {
            if (CrossServerUtility.IsCrossServer())
            {
                var sendInfo = new CC003_tagCGForceQuitCrossState();
                GameNetSystem.Instance.SendInfo(sendInfo);
            }
            else
            {
                var mapConfig = MapConfig.Get(PlayerDatas.Instance.baseData.MapID);
                if (mapConfig.MapFBType == (int)MapType.OpenCountry)
                {
                    var sjzMapConfig = MapConfig.Get(10010);
                    var position = new Vector3(sjzMapConfig.BornPoints[0].x, 0, sjzMapConfig.BornPoints[0].y);
                    MapTransferUtility.Send_WorldTransfer(10010, position, MapTransferType.WorldTransport, 255, 0);
                }
                else
                {
                    ModelCenter.Instance.GetModel<DungeonModel>().ExitCurrentDungeon();
                }
            }
            done = true;
        }
        public override void End()
        {
        }
        public override void Update()
        {
        }
    }
    private static string GetAssetBundleNameByMapId(int mapId, int lineId)
    {
        switch (mapId)
        {
            case 0:
                return string.Empty;
            case 1:
                return "maps/level_login";
            case 2:
            case 3:
                return "maps/createrole_001";
            default:
                var dataMapId = MapUtility.GetDataMapId(mapId);
                var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                if (config != null)
                {
                    return StringUtility.Contact("maps/", config.MapResources);
                }
                else
                {
                    return string.Empty;
                }
        }
    }
}
System/Alchemy/AlchemyModel.cs
@@ -460,6 +460,8 @@
                m_AlchemingClock = Clock.AlarmAfter(seconds, CheckRedpoint);
            }
            var lastLevel = stoveLevel;
            stoveLevel = package.StoveLV;
            stoveExp = (int)package.StoveExp;
@@ -474,6 +476,7 @@
                            id = (int)package.ItemID,
                            count = package.ItemCnt,
                        };
                        AlchemyResultWin.lastLevel = lastLevel;
                        WindowCenter.Instance.Open<AlchemyResultWin>();
                    }
                }
System/Alchemy/AlchemyResultWin.cs
@@ -19,14 +19,18 @@
        [SerializeField] Transform m_ContainerDefeat;
        [SerializeField] Text m_StoveLevel;
        [SerializeField] Text m_StoveExp;
        [SerializeField] Slider m_Slider;
        [SerializeField] IntensifySmoothSlider m_Slider;
        [SerializeField] ItemBehaviour m_Item;
        [SerializeField] Text m_CloseTip;
        [SerializeField] Image m_FairyStove;
        [SerializeField] Image m_NormalStove;
        [SerializeField] UIEffect m_LevelUpEffect;
        [SerializeField] Button m_Close;
        public static Item displayItem;
        public static int lastLevel = 0;
        int recordLevel = 0;
        DateTime openTime = DateTime.Now;
@@ -69,6 +73,12 @@
            {
                m_CloseTip.gameObject.SetActive(true);
            }
            if (m_Slider.CurrentStage != recordLevel)
            {
                recordLevel = m_Slider.CurrentStage;
                m_LevelUpEffect.Play();
            }
        }
        #endregion
@@ -93,13 +103,21 @@
            m_StoveLevel.text = StringUtility.Contact("Lv.", model.stoveLevel);
            var isMax = !RefineStoveConfig.Has(model.stoveLevel + 1);
            var stoveConfig = RefineStoveConfig.Get(model.stoveLevel);
            recordLevel = lastLevel;
            m_Slider.stage = lastLevel;
            m_Slider.ResetStage();
            if (isMax)
            {
                m_StoveExp.text = Language.Get("L1055");
                m_Slider.delay = 0;
                m_Slider.value = 1;
            }
            else
            {
                m_Slider.stage = model.stoveLevel;
                m_StoveExp.text = StringUtility.Contact(model.stoveExp, "/", stoveConfig.Exp);
                var progress = Mathf.Clamp01((float)model.stoveExp / stoveConfig.Exp);
                m_Slider.value = progress;
System/EquipTrain/EquipTrain.cs
@@ -48,17 +48,6 @@
            return equipTrains.ContainsKey(place) ? equipTrains[place].trainLevel : 0;
        }
        public int GetTotalLevel()
        {
            var level = 0;
            foreach (var item in equipTrains.Values)
            {
                level += item.trainLevel;
            }
            return level;
        }
        public void UpdateUnSavedProperties(int place, Int3 unSavedProperties)
        {
            if (equipTrains.ContainsKey(place))
@@ -123,14 +112,14 @@
            this.level = level;
            this.place = place;
            this.trainType = trainType;
            this.trainLevel = 1;
            this.trainLevel = 0;
            redpoint = new Redpoint(910000 + level * 100, 910000 + level * 100 + place);
        }
        public void Reset()
        {
            this.trainLevel = 1;
            this.trainLevel = 0;
            this.unSavedProperties = Int3.zero;
            this.trainedProperties = Int3.zero;
        }
System/EquipTrain/EquipTrainModel.cs
@@ -140,7 +140,7 @@
        public void Train(Int2 equipPosition, bool[] inevitables)
        {
            var maxLevel = GetMaxTrainLevel(equipPosition);
            if (maxLevel < 1)
            if (maxLevel < 0)
            {
                SysNotifyMgr.Instance.ShowTip("WashStarRequirement");
                return;
@@ -312,7 +312,7 @@
            }
            var maxLevel = GetMaxTrainLevel(equipPosition);
            if (maxLevel < 1)
            if (maxLevel < 0)
            {
                SysNotifyMgr.Instance.ShowTip("WashStarRequirement");
                return;
@@ -388,26 +388,16 @@
            var equip = equipModel.GetEquip(equipPosition);
            if (string.IsNullOrEmpty(equip))
            {
                return 0;
                return -1;
            }
            if (!equipTrains.ContainsKey(equipPosition.x))
            {
                return 0;
                return -1;
            }
            var maxLevel = GetMaxTrainLevel(equipPosition);
            return Mathf.Min(maxLevel, equipTrains[equipPosition.x].GetTrainLevel(equipPosition.y));
        }
        public int GetTotalLevel(int level)
        {
            if (!equipTrains.ContainsKey(level))
            {
                return 0;
            }
            return equipTrains[level].GetTotalLevel();
        }
        public int GetMaterialNeed(Int2 equipPosition)
@@ -430,7 +420,7 @@
            var equip = equipModel.GetEquip(equipPosition);
            if (string.IsNullOrEmpty(equip))
            {
                return 0;
                return -1;
            }
            var star = starModel.GetEquipStarLevel(equipPosition);
@@ -438,7 +428,7 @@
            var config = WashLevelMaxConfig.Get(type, star);
            if (config == null)
            {
                return 0;
                return -1;
            }
            else
            {
@@ -463,14 +453,14 @@
            var type = GetTrainType(equipPosition.y);
            var currentTrainLevel = GetTrainLevel(equipPosition);
            var absoluteMax = GetMaxTrainLevel(equipPosition.y);
            var data = EquipWashConfig.Get(type, Mathf.Clamp(currentTrainLevel, 1, absoluteMax));
            var data = EquipWashConfig.Get(type, Mathf.Clamp(currentTrainLevel, 0, absoluteMax));
            if (data == null)
            {
                return TrainState.Empty;
            }
            var relativeMax = GetMaxTrainLevel(new Int2(equip.config.LV, equip.config.EquipPlace));
            if (relativeMax == 0)
            if (relativeMax == -1)
            {
                return TrainState.StarLimit;
            }
@@ -540,7 +530,7 @@
            var unSavedProperties = GetUnSavedProperties(equipPosition);
            var trainedProperties = GetTrainedProperties(equipPosition);
            var trainLevel = GetTrainLevel(equipPosition);
            var data = EquipWashConfig.Get(GetTrainType(equipPosition.y), Mathf.Clamp(trainLevel, 1, absoluteMax));
            var data = EquipWashConfig.Get(GetTrainType(equipPosition.y), Mathf.Clamp(trainLevel, 0, absoluteMax));
            if (data != null)
            {
System/EquipTrain/EquipTrainWin.cs
@@ -165,7 +165,7 @@
                {
                    m_MaxTrainLevel.text = "穿戴装备可洗炼";
                }
                else if (maxTrain > 0)
                else if (maxTrain >= 0)
                {
                    var star = starModel.GetEquipStarLevel(equipPosition);
                    m_MaxTrainLevel.text = string.Format("{0}星装备最高可洗炼至{1}级", star, maxTrain);
System/MainInterfacePanel/DialogueDuidanceWin.cs
@@ -14,39 +14,37 @@
    public class DialogueDuidanceWin : Window
    {
        [SerializeField] Button m_MarkRay;
        [SerializeField] Button m_SKIPButton;
        [SerializeField] GameObject m_ContainerNpc;
        [SerializeField] RawImage m_RawNpc;
        [SerializeField] Text m_NpcName;
        [SerializeField] Text m_NpcDialogue;
        [SerializeField] Transform m_NpcRewardContainer;
        [SerializeField] GameObject m_BaseboardImageNPC;
        [SerializeField] RawImage m_NPCIcon;
        [SerializeField] Text m_NPCNameText;
        [SerializeField] Text m_ContentText_Npc;
        [SerializeField] GameObject m_ContainerPlayer;
        [SerializeField] RawImage m_RawPlayer;
        [SerializeField] Text m_PlayerName;
        [SerializeField] Text m_PlayerDialogue;
        [SerializeField] Transform m_PlayerRewardContainer;
        [SerializeField] GameObject m_BaseboardImagePlayer;
        [SerializeField] RawImage m_playerIcon;
        [SerializeField] Text m_PlayerNameText;
        [SerializeField] Text m_ContentText;
        [SerializeField] Transform m_ContainerReward;
        [SerializeField] ItemCell[] m_Items;
        [SerializeField] Text m_NextText;
        [SerializeField] Text m_Remind;
        int[] sPeaker;//对话对应半身像(0为主角/1为NPC)
        [SerializeField] Button m_EmptyAccepter;
        [SerializeField] Button m_Skip;
        int taskIndex = 0;//获取当前的任务
        int typesPeaker = -1;
        float timer = 0f;
        public static int storyMissionId = 0;
        public static int taskId = 0;
        private float timeType = 0f;
        TaskModel m_TaskModel;
        TaskModel taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<TaskModel>()); } }
        static int autoContinueSeconds;
        TreasureModel m_treasureModel;
        TreasureModel treasureModel { get { return m_treasureModel ?? (m_treasureModel = ModelCenter.Instance.GetModel<TreasureModel>()); } }
        TaskModel model { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
        PlayerMainDate mainModel { get { return ModelCenter.Instance.GetModel<PlayerMainDate>(); } }
        PlayerMainDate m_MainModel;
        PlayerMainDate mainModel { get { return m_MainModel ?? (m_MainModel = ModelCenter.Instance.GetModel<PlayerMainDate>()); } }
        private int IsMultistage = 0;//是否有多段对话0,没有1,有
        private int FabaoId;
        private int AwaitSecond;
        #region Built-in
        private enum TaskType
        {
@@ -57,68 +55,44 @@
        protected override void BindController()
        {
            var config = FuncConfigConfig.Get("TaskContinue");
            FabaoId = int.Parse(config.Numerical1);
            AwaitSecond = int.Parse(config.Numerical2);
            autoContinueSeconds = int.Parse(config.Numerical2);
        }
        protected override void AddListeners()
        {
            m_MarkRay.AddListener(OnClickMarkRay);
            m_SKIPButton.AddListener(OnClickSKIPButton);
            m_EmptyAccepter.AddListener(EmptyAccepter);
            m_Skip.AddListener(OnSkip);
        }
        protected override void OnPreOpen()
        {
            timeType = 0;
            m_NextText.text = string.Format(Language.Get("TaskContinueCount"), AwaitSecond);
            IsCloseWindow();
            typesPeaker = -1;
            timer = 0;
            taskIndex = 0;
            var config = StoryMissionsConfig.Get(storyMissionId);
            if (config.TaskMusic != 0)
            {
                SoundPlayer.Instance.PlayNpcAudio(config.TaskMusic);
            }
            if (config == null)
            {
                return;
            }
            sPeaker = config.Speaker1;
            taskIndex = config.TalkNum[0];
            ShowDialogSelect(sPeaker[0], taskIndex);
        }
        private void IsCloseWindow()
        {
            if (WindowCenter.Instance.IsOpen<DungeonFightWin>())
            {
                WindowCenter.Instance.Close<DungeonFightWin>();
            }
            if (WindowCenter.Instance.IsOpen<DungeonMissionDetailsWin>())
            {
                WindowCenter.Instance.Close<DungeonMissionDetailsWin>();
            }
            DisplayTimer();
            VerifyCloseOtherWindow();
            DisplayDialogue();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
            UI3DModelExhibition.Instance.StopShow();
        }
        private void IsOpenMaininterface()
        {
            Close();
        }
        protected override void OnAfterClose()
        {
            bool _bool = IsDungeon();
            if (_bool)
            if (MapUtility.IsDungeon(PlayerDatas.Instance.baseData.MapID))
            {
                WindowCenter.Instance.Open<DungeonFightWin>();
            }
@@ -127,6 +101,7 @@
                WindowCenter.Instance.Open<MainInterfaceWin>();
            }
        }
        protected override void LateUpdate()
        {
            if (WindowCenter.Instance.IsOpen("MainInterfaceWin"))
@@ -134,17 +109,14 @@
                WindowCenter.Instance.Close<DialogueDuidanceWin>();
            }
            timeType += Time.deltaTime;
            if (timeType >= AwaitSecond)
            timer += Time.deltaTime;
            if (timer >= autoContinueSeconds)
            {
                m_NextText.text = string.Format(Language.Get("TaskContinueCount"), 0);
                OnClickSKIPButton();
                OnSkip();
                mainModel.IsSelfMotionTask = true;
            }
            else
            {
                m_NextText.text = string.Format(Language.Get("TaskContinueCount"), AwaitSecond - (int)timeType);
            }
            DisplayTimer();
            if (this is BossShowDialogueWin)
            {
@@ -162,104 +134,160 @@
                    hero.LockTarget = null;
                }
            }
        }
        private void OnClickMarkRay()
        private void VerifyCloseOtherWindow()
        {
            timeType = 0;
            var config = StoryMissionsConfig.Get(storyMissionId);
            if (config == null)
            if (WindowCenter.Instance.IsOpen<DungeonFightWin>())
            {
                return;
                WindowCenter.Instance.Close<DungeonFightWin>();
            }
            if (WindowCenter.Instance.IsOpen<DungeonMissionDetailsWin>())
            {
                WindowCenter.Instance.Close<DungeonMissionDetailsWin>();
            }
        }
        void DisplayTimer()
        {
            if (timer >= autoContinueSeconds)
            {
                m_Remind.text = string.Format(Language.Get("TaskContinueCount"), 0);
            }
            else
            {
                m_Remind.text = string.Format(Language.Get("TaskContinueCount"), autoContinueSeconds - (int)timer);
            }
        }
        private void EmptyAccepter()
        {
            timer = 0;
            var config = StoryMissionsConfig.Get(storyMissionId);
            taskIndex += 1;
            var end = config.TalkNum.Length > 1 ? config.TalkNum[1] : config.TalkNum[0];
            if (taskIndex <= end)//下一条
            if (taskIndex >= config.TalkNum.Length)
            {
                ShowDialogSelect(sPeaker[taskIndex], taskIndex);
                SendCompleteTask(TaskType.OK);
                CloseClick();
            }
            else//最后一条
            else
            {
                SessionEnd(TaskType.OK);
                Close();
                WindowCenter.Instance.Open<MainInterfaceWin>();
                bool _bool = IsDungeon();
                if (_bool)
                {
                    WindowCenter.Instance.Open<DungeonFightWin>();
                }
                DisplayDialogue();
            }
        }
        private void OnClickSKIPButton()
        #endregion
        private void OnSkip()
        {
            SendCompleteTask(TaskType.OK);
            mainModel.IsSelfMotionTask = false;
            CloseClick();
            HeroAIRecorder.ClearRecord();
        }
        private void DisplayDialogue()
        {
            var config = StoryMissionsConfig.Get(storyMissionId);
            if (config != null)
            {
                SessionEnd(TaskType.OK);
            }
            mainModel.IsSelfMotionTask = false;
            Close();
            HeroAIRecorder.ClearRecord();
            WindowCenter.Instance.Open<MainInterfaceWin>();
        }
        #endregion
        private void ShowDialogSelect(int type, int stepNum)
        {
            if (type == 0)
            timer = 0f;
            DisplayTimer();
            var talkType = config.Speaker1[taskIndex];
            m_ContainerNpc.gameObject.SetActive(talkType == 1);
            m_ContainerPlayer.gameObject.SetActive(talkType == 0);
            var state = 0;
            model.TryGetCustomTaskState(taskId, out state);
            m_ContainerReward.gameObject.SetActive(false);
            var displayReward = state == -5 && taskIndex == config.TalkNum.Length - 1;
            if (displayReward)
            {
                if (typesPeaker != type)
                List<RewardAnalysis.RewardInfo> rewardInfos = new List<RewardAnalysis.RewardInfo>();
                if (model.allMissionDict.ContainsKey(taskId))
                {
                    m_BaseboardImageNPC.SetActive(false);
                    m_BaseboardImagePlayer.SetActive(true);
                    var taskInfoKey = model.allMissionDict[taskId].RewardList;
                    var taskInfoConfig = TASKINFOConfig.Get(taskInfoKey);
                    if (taskInfoConfig != null)
                    {
                        var rewardContent = TaskAllocation.Instance.GetTaskInfo(taskInfoConfig.show_writing, taskId);
                        RewardAnalysis.Inst.GetReward(rewardContent, ref rewardInfos);
                    }
                }
                int playerJob = PlayerDatas.Instance.baseData.Job;
                displayReward = rewardInfos.Count > 0;
                UI3DModelExhibition.Instance.ShowPlayer(m_playerIcon, playerJob, true);
                m_PlayerNameText.text = PlayerDatas.Instance.baseData.PlayerName;
                string platercContentKey = StoryMissionsConfig.Get(storyMissionId).content;
                var config = TASKINFOConfig.Get(string.Format(platercContentKey, stepNum));
                if (config != null)
                if (displayReward)
                {
                    m_ContentText.text = config.show_writing;
                    m_ContainerReward.gameObject.SetActive(true);
                    m_ContainerReward.SetParent(talkType == 0 ? m_PlayerRewardContainer : m_NpcRewardContainer);
                    for (int i = 0; i < m_Items.Length; i++)
                    {
                        if (i < rewardInfos.Count)
                        {
                            m_Items[i].gameObject.SetActive(true);
                            var itemId = rewardInfos[i].itemCfg.ID;
                            ulong count = (ulong)rewardInfos[i].num;
                            if (rewardInfos[i].expPoint != 0)
                            {
                                count += (ulong)rewardInfos[i].expPoint * 100000000;
                            }
                            var itemData = new ItemCellModel(itemId, true, count);
                            m_Items[i].Init(itemData);
                            m_Items[i].button.SetListener(() =>
                            {
                                ItemTipUtility.Show(itemId);
                            });
                        }
                        else
                        {
                            m_Items[i].gameObject.SetActive(false);
                        }
                    }
                }
            }
            if (talkType == 0)
            {
                int playerJob = PlayerDatas.Instance.baseData.Job;
                m_RawPlayer.gameObject.SetActive(true);
                UI3DModelExhibition.Instance.ShowPlayer(m_RawPlayer, playerJob, true);
                m_PlayerName.text = PlayerDatas.Instance.baseData.PlayerName;
                var taskInfoKey = StoryMissionsConfig.Get(storyMissionId).content;
                var taskInfoConfig = TASKINFOConfig.Get(string.Format(taskInfoKey, config.TalkNum[taskIndex]));
                if (taskInfoConfig != null)
                {
                    m_PlayerDialogue.text = taskInfoConfig.show_writing;
                }
                else
                {
                    DebugEx.LogError("TaskInFo中没有这个Key。。" + string.Format(platercContentKey, stepNum));
                    DebugEx.LogError("TaskInFo中没有这个Key。。" + string.Format(taskInfoKey, config.TalkNum[taskIndex]));
                }
            }
            if (type == 1)
            else if (talkType == 1)
            {
                if (typesPeaker != type)
                {
                    m_BaseboardImageNPC.SetActive(true);
                    m_BaseboardImagePlayer.SetActive(false);
                }
                var configStoryMissions = StoryMissionsConfig.Get(storyMissionId);
                if (configStoryMissions == null)
                {
                    return;
                }
                int npcId = configStoryMissions.NpcID;
                int npcId = config.NpcID;
                var npcConfig = NPCConfig.Get(npcId);
                m_NPCNameText.text = npcConfig.charName;
                string npcContentKey = configStoryMissions.content;
                var taskInfo = TASKINFOConfig.Get(string.Format(npcContentKey, stepNum));
                if (taskInfo == null)
                m_NpcName.text = npcConfig.charName;
                var taskInfoKey = config.content;
                var taskInfoConfig = TASKINFOConfig.Get(string.Format(taskInfoKey, config.TalkNum[taskIndex]));
                if (taskInfoConfig == null)
                {
                    DebugEx.LogError("TASKINFOConfig中没有找到对应的Key");
                }
                else
                {
                    m_ContentText_Npc.text = taskInfo.show_writing;
                    m_NpcDialogue.text = taskInfoConfig.show_writing;
                }
                var data = new UI3DNPCExhibitionData()
@@ -267,35 +295,28 @@
                    npcId = npcId,
                    isDialogue = true,
                };
                UI3DModelExhibition.Instance.ShowNPC(m_NPCIcon, data);
                m_RawNpc.gameObject.SetActive(true);
                UI3DModelExhibition.Instance.ShowNPC(m_RawNpc, data);
            }
            typesPeaker = type;
        }
        private void SessionEnd(TaskType taskType)
        private void SendCompleteTask(TaskType taskType)
        {
            switch (taskType)
            {
                case TaskType.OK:
                case TaskType.FB:
                    taskmodel.RequestGetTaskAward("OK");
                    model.RequestGetTaskAward("OK");
                    break;
                case TaskType.Double:
                    taskmodel.RequestGetTaskAward("Double");
                    model.RequestGetTaskAward("Double");
                    break;
                default:
                    break;
            }
        }
        private bool IsDungeon()
        {
            var mapId = PlayerDatas.Instance.baseData.MapID;
            var mapConfig = MapConfig.Get(mapId);
            return mapConfig != null && mapConfig.MapFBType != 0;
        }
    }
}
System/MainInterfacePanel/TaskModel.cs
@@ -397,6 +397,7 @@
                {
                    WindowCenter.Instance.Close<MainInterfaceWin>();
                    DialogueDuidanceWin.storyMissionId = config.id;
                    DialogueDuidanceWin.taskId = taskID;
                    WindowCenter.Instance.Open<DialogueDuidanceWin>();
                }
                return;
System/Role/ReikiRootModel.cs
@@ -12,6 +12,7 @@
        Dictionary<int, int> m_ReikiQualityMapColors;
        Dictionary<int, int> m_CacheReikiRootPoints = new Dictionary<int, int>();
        Dictionary<int, Dictionary<int, int[]>> m_PromotePropertyValues = new Dictionary<int, Dictionary<int, int[]>>();
        Dictionary<int, int> m_ReikiPropertyValues = new Dictionary<int, int>();
        public List<int> reikiRoots = new List<int>();
@@ -202,16 +203,14 @@
            return m_CacheReikiRootPoints.ContainsKey(id) ? m_CacheReikiRootPoints[id] : 0;
        }
        public bool ExistAnyWashPoint()
        public int GetTotalWashPoint()
        {
            var totalPoint = 0;
            foreach (var point in m_ReikiRootFreePoints.Values)
            {
                if (point > 0)
                {
                    return true;
                }
                totalPoint += point;
            }
            return false;
            return totalPoint;
        }
        public List<ReikiRootRecommend> GetReikiRootRecommendPoint(int point)
@@ -345,6 +344,15 @@
            propertyDict[promotePropertyId] += GetQualityProperty(id, quality);
        }
        public int GetReikiPropertyValue(int id)
        {
            if (m_ReikiPropertyValues.ContainsKey(id))
            {
                return m_ReikiPropertyValues[id];
            }
            return 0;
        }
        public int GetQualityProperty(int id, int quality)
        {
            var config = ReikiRootConfig.Get(id);
@@ -413,9 +421,11 @@
        public void RefreshReikiRootPoint()
        {
            m_ReikiPropertyValues.Clear();
            foreach (var id in reikiRoots)
            {
                m_ReikiRootPoints[id] = (int)UIHelper.GetPropertyValue((PropertyType)id);
                GetReikiRootProperty(id, m_ReikiRootPoints[id],ref m_ReikiPropertyValues);
            }
            if (onReikiRootPointRefresh != null)
            {
System/Role/ReikiRootPointBehaviour.cs
@@ -73,6 +73,7 @@
            m_Icon.SetSprite("XT_LG_" + id);
            DisplayPoint();
            DisplayButtonState();
            model.onReikiRootPointRefresh += OnReikiRootPointRefresh;
            PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
@@ -143,7 +144,7 @@
        private void OnMax()
        {
            point = model.cacheFreePoint;
            point += model.cacheFreePoint;
            model.cacheFreePoint = 0;
        }
System/Role/ReikiRootResetWin.cs
@@ -16,7 +16,9 @@
    {
        [SerializeField] Transform m_ContainerFree;
        [SerializeField] Text m_FreeRemind;
        [SerializeField] Text m_ResetRemind1;
        [SerializeField] Transform m_ContainerCost;
        [SerializeField] Text m_ResetRemind2;
        [SerializeField] ItemBehaviour m_Item;
        [SerializeField] Button m_Reset;
        [SerializeField] Button m_Close;
@@ -66,6 +68,8 @@
            m_FreeRemind.gameObject.SetActive(freeReset);
            m_FreeRemind.text = string.Format("{0}级前免费", model.freeResetLevel);
            m_ResetRemind1.text = Language.Get("ResetPoint", model.GetTotalWashPoint());
            m_ResetRemind2.text = Language.Get("ResetPoint", model.GetTotalWashPoint());
            if (!freeReset)
            {
System/Role/ReikiRootWin.cs
@@ -68,12 +68,12 @@
                }
            }
            ReikiFuncOpenWin.onFlyComplete += OnFlyComplete;
            m_NumKeyboard.gameObject.SetActive(false);
            model.onCacheFreePointRefresh += OnCacheFreePointRefresh;
            PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
            ReikiFuncOpenWin.onFlyComplete += OnFlyComplete;
            model.onReikiRootPointRefresh += OnReikiRootPointRefresh;
            Display();
        }
@@ -92,6 +92,7 @@
            model.onCacheFreePointRefresh -= OnCacheFreePointRefresh;
            PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
            ReikiFuncOpenWin.onFlyComplete -= OnFlyComplete;
            model.onReikiRootPointRefresh -= OnReikiRootPointRefresh;
            for (int i = 0; i < m_ReikiRootPoints.Count; i++)
            {
                m_ReikiRootPoints[i].Dispose();
@@ -202,7 +203,7 @@
        private void OnReset()
        {
            if (!model.ExistAnyWashPoint())
            if (model.GetTotalWashPoint() <= 0)
            {
                SysNotifyMgr.Instance.ShowTip("NoneReikiPointCanWash");
                return;
@@ -310,6 +311,11 @@
                propertyRefreshDirty = true;
            }
        }
        private void OnReikiRootPointRefresh()
        {
            propertyRefreshDirty = true;
        }
    }
}
Utility/UIHelper.cs
@@ -250,6 +250,10 @@
                return PlayerDatas.Instance.baseData.reduceHeartHurt;
            case PropertyType.ReduceFinalHurtPer:
                return PlayerDatas.Instance.baseData.reduceFinalHurt;
            case PropertyType.AtkPercent:
            case PropertyType.CritHurtPercent:
            case PropertyType.DodgePercent:
                return ModelCenter.Instance.GetModel<ReikiRootModel>().GetReikiPropertyValue((int)type);
        }
        return 0;
    }