少年修仙传客户端代码仓库
client_Hale
2019-04-25 7959c89a3469bc513c5f2669e1e4cae07039d2d2
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
9个文件已修改
203 ■■■■ 已修改文件
Fight/MapTransferUtility.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ItemTip/PetMountTipWin.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/HumanTreasureTaskCell.cs 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/HumanTreasureWin.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureChapterWin.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureCollectBriefInfoBehaviour.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureModel.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WorldMap/LocalMapFindPath.cs 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WorldMap/LocalMapTag.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/MapTransferUtility.cs
@@ -890,7 +890,7 @@
        }
    }
    public void MoveToLocalMapPosition(Vector3 _position)
    public void MoveToLocalMapPosition(Vector2 _position)
    {
        var hero = PlayerDatas.Instance.hero;
        if (GA_Hero.s_MapSwitching || hero == null)
System/ItemTip/PetMountTipWin.cs
@@ -140,6 +140,8 @@
        {
            var baseInfo = ItemTipUtility.mainTipData.baseInfo;
            var config = ItemConfig.Get(baseInfo.itemId);
            m_Model.gameObject.SetActive(config.Type == 26 || config.Type == 41 || config.Type == 42);
            switch (config.Type)
            {
                case 26:
System/Treasure/HumanTreasureTaskCell.cs
@@ -9,6 +9,8 @@
{
    public class HumanTreasureTaskCell : CellView
    {
        [SerializeField] UIEffect m_EffectAppear;
        [SerializeField] UIEffect m_EffectGoto;
        [SerializeField] UIAlphaTween m_AlphaTween;
        [SerializeField] Text m_ClueName;
        [SerializeField] Transform m_ContainerCollected;
@@ -26,7 +28,12 @@
            m_Goto.AddListener(Goto);
        }
        public void Display(int clue, bool animationStep = false)
        private void OnDisable()
        {
            StopAllCoroutines();
        }
        public void Display(int clue, bool animationStep, float displayTime)
        {
            var config = TreasureConfig.Get(model.selectedTreasure);
            Dictionary<int, List<int>> clues;
@@ -79,17 +86,31 @@
            m_ContainerCutline.gameObject.SetActive(lastClue != clue);
            if (!animationStep)
            if (!animationStep || !gameObject.activeInHierarchy)
            {
                m_AlphaTween.SetEndState();
                m_EffectGoto.gameObject.SetActive(true);
            }
            else
            {
                m_AlphaTween.SetStartState();
                m_AlphaTween.Play();
                StartCoroutine(Co_Display(displayTime));
                m_EffectGoto.gameObject.SetActive(false);
            }
        }
        IEnumerator Co_Display(float time)
        {
            yield return WaitingForSecondConst.GetWaitForSeconds(time);
            m_EffectAppear.Play();
            m_AlphaTween.Play(OnComplete);
        }
        private void OnComplete()
        {
            m_EffectGoto.gameObject.SetActive(true);
        }
        private void Goto()
        {
            WindowJumpMgr.Instance.ClearJumpData();
System/Treasure/HumanTreasureWin.cs
@@ -30,6 +30,7 @@
        [SerializeField] Text m_ChallengeCondition;
        [SerializeField] Slider m_TaskSlider;
        [SerializeField] Text m_TaskProgress;
        [SerializeField] UIEffect m_EffectInduction;
        [SerializeField] Transform m_ContainerSkillDetial;
        [SerializeField] Image m_SkillDetailIcon;
@@ -42,6 +43,8 @@
        [SerializeField] ScrollerController m_TaskController;
        bool animationStep = false;
        float displayTime = 0f;
        List<int> animationClues = new List<int>();
@@ -166,6 +169,8 @@
            animationClues.Clear();
            displayTime = 0f;
            m_TaskController.Refresh();
            Dictionary<int, List<int>> clues;
            if (model.TryGetTreasureClues(model.selectedTreasure, out clues))
@@ -209,6 +214,18 @@
            }
            m_TaskController.Restart();
            animationClues.Clear();
            if (taskAnimation)
            {
                Clock.AlarmAfter(Mathf.CeilToInt(displayTime + 0.6f), () =>
                {
                    m_TaskController.mScrollRect.enabled = true;
                });
            }
            else
            {
                m_TaskController.mScrollRect.enabled = true;
            }
        }
        void DisplayAnimation()
@@ -268,13 +285,15 @@
            {
                var count = m_TaskController.GetNumberOfCells(m_TaskController.m_Scorller);
                m_TaskController.JumpIndex(count - 1);
                m_EffectInduction.Play();
                m_TaskController.mScrollRect.enabled = false;
                StartCoroutine(Co_DelayShowTask());
            }
        }
        IEnumerator Co_DelayShowTask()
        {
            yield return WaitingForSecondConst.WaitMS1000;
            yield return WaitingForSecondConst.WaitMS3000;
            DisplayTasks(true);
        }
@@ -315,12 +334,14 @@
            if (type == ScrollerDataType.Header)
            {
                var taskCell = cell as HumanTreasureTaskCell;
                taskCell.transform.SetParent(m_TaskController.m_Scorller.LayoutGroup.transform);
                var animation = false;
                if (animationClues.Contains(cell.index))
                {
                    animation = true;
                    displayTime += 0.6f;
                }
                taskCell.Display(cell.index, animation);
                taskCell.Display(cell.index, animation, displayTime);
            }
        }
System/Treasure/TreasureChapterWin.cs
@@ -30,7 +30,7 @@
        FunctionUnlockFlyObject flyObject = null;
        public static bool displaying = false;
        public static int displayId = 0;
        TreasureModel model { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
        TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
@@ -47,8 +47,6 @@
        protected override void OnPreOpen()
        {
            displaying = true;
            if (flyObject != null)
            {
                Destroy(flyObject);
@@ -84,7 +82,7 @@
        protected override void OnPreClose()
        {
            displaying = false;
            model.treasureChapterId = 0;
        }
        protected override void OnAfterClose()
System/Treasure/TreasureCollectBriefInfoBehaviour.cs
@@ -49,6 +49,7 @@
        Coroutine m_CacheCoroutine = null;
        TreasureModel model { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
        TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
        public void Display()
        {
@@ -57,6 +58,7 @@
            model.treasureStateChangeEvent += TreasureStateChangeEvent;
            model.treasureCollectProgressRefresh += TreasureCollectProgressRefresh;
            WindowCenter.Instance.windowAfterOpenEvent += WindowAfterOpenEvent;
            WindowCenter.Instance.windowAfterCloseEvent += WindowBeforeCloseEvent;
            dirty = false;
            DisplayBase();
@@ -79,7 +81,10 @@
                    StopCoroutine(m_CacheCoroutine);
                    m_CacheCoroutine = null;
                }
                m_CacheCoroutine = StartCoroutine(Co_StopEffect());
                if (gameObject.activeInHierarchy)
                {
                    m_CacheCoroutine = StartCoroutine(Co_StopEffect());
                }
            }
        }
@@ -92,7 +97,7 @@
        void DisplayBase()
        {
            bool isChapterOpen = TreasureChapterWin.displaying;
            bool isChapterOpen = model.treasureChapterId != 0;
            m_ContainerUnknown.gameObject.SetActive(displayId == 0 || isChapterOpen);
            m_ContainerCollect.gameObject.SetActive(displayId != 0 && !isChapterOpen);
@@ -163,6 +168,26 @@
            return 0;
        }
        int GetLostTreasure()
        {
            var treasureIds = model.GetTreasureCategory(TreasureCategory.Human);
            var latestTask = taskModel.GetLatestMainTaskId();
            foreach (var id in treasureIds)
            {
                List<int> tasks;
                if (model.TryGetTreasureTasks(id, out tasks))
                {
                    if (latestTask < tasks[0])
                    {
                        return id;
                    }
                }
            }
            return 0;
        }
        bool IsAllCompleted()
        {
            var treasureIds = model.GetTreasureCategory(TreasureCategory.Human);
@@ -188,6 +213,14 @@
            }
        }
        private void WindowBeforeCloseEvent(Window window)
        {
            if (window is TreasureChapterWin)
            {
                DisplayBase();
            }
        }
        private void LateUpdate()
        {
            if (dirty)
@@ -202,6 +235,7 @@
            model.treasureStateChangeEvent -= TreasureStateChangeEvent;
            model.treasureCollectProgressRefresh -= TreasureCollectProgressRefresh;
            WindowCenter.Instance.windowAfterOpenEvent -= WindowAfterOpenEvent;
            WindowCenter.Instance.windowAfterCloseEvent -= WindowBeforeCloseEvent;
            if (m_CacheCoroutine != null)
            {
                StopCoroutine(m_CacheCoroutine);
System/Treasure/TreasureModel.cs
@@ -144,7 +144,7 @@
        public int exitRecord { get; set; }
        public int entranceOpenCondition { get; private set; }
        public int treasureChapterId { get; private set; }
        public int treasureChapterId { get; set; }
        TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
@@ -1065,6 +1065,7 @@
                {
                    treasureChapterId = config.id;
                    PopupWindowsProcessor.Instance.Add("TreasureChapterWin");
                    break;
                }
            }
        }
System/WorldMap/LocalMapFindPath.cs
@@ -69,7 +69,8 @@
            mapMatrix = new LocalMap(mapId, mapWidth, mapHeight, uiMapWidth, uiMapHeight);
            DrawWayPoints();
            DrawFunctionNPCs();
            DrawFunctionNpcs();
            DrawJumpPoints();
            DrawEventPoints();
            m_HeroHead.transform.SetAsLastSibling();
            FoucsEventPoint(model.selectedMapEventPoint);
@@ -255,20 +256,12 @@
            var behaviour = LocalMapTagPool.Require(npcType);
            tagBehaviours.Add(behaviour);
            if (npcType == LocalMapTag.TagType.Boss)
            {
                behaviour.Display(eventPointConfig.NPCID, (TextColType)eventPointConfig.Colour, npcPos);
            }
            else
            {
                behaviour.Display(npcConfig.NPCID, (TextColType)eventPointConfig.Colour);
            }
            behaviour.Display(npcType == LocalMapTag.TagType.Boss ? eventPointConfig.NPCID : npcConfig.NPCID, (TextColType)eventPointConfig.Colour);
            var pathPointPos = mapMatrix.WorldToLocalPosition(npcPos);
            behaviour.transform.SetParentEx(m_LocalMapRect, pathPointPos, Quaternion.identity, Vector3.one);
            behaviour.gameObject.SetActive(true);
        }
        private void DrawWayPoints()
        {
@@ -295,7 +288,7 @@
            behaviour.gameObject.SetActive(true);
        }
        private void DrawFunctionNPCs()
        private void DrawFunctionNpcs()
        {
            var npcRefreshIds = model.GetMapNPCRefreshIds(mapId);
            if (npcRefreshIds != null)
@@ -304,12 +297,12 @@
                {
                    var config = mapnpcConfig.Get(item);
                    var npcConfig = NPCConfig.Get(config.NPCID);
                    DrawFunctionNPC(item);
                    DrawFunctionNpc(item);
                }
            }
        }
        private void DrawFunctionNPC(string _refreshId)
        private void DrawFunctionNpc(string _refreshId)
        {
            var mapNpcConfig = mapnpcConfig.Get(_refreshId);
@@ -325,6 +318,41 @@
            behaviour.Display(mapNpcConfig.NPCID, TextColType.White);
        }
        private void DrawJumpPoints()
        {
            var mapData = H2Engine.MapData.LoadFormFile(mapId);
            if (mapData == null)
            {
                return;
            }
            var transfers = mapData.transfers;
            var jumpPoints = new List<Vector3>();
            foreach (var transfer in transfers)
            {
                foreach (var transferPoint in transfer.transferPoints)
                {
                    jumpPoints.Add(transferPoint.position);
                }
            }
            foreach (var jumpPoint in jumpPoints)
            {
                DrawJumpPoint(jumpPoint);
            }
        }
        private void DrawJumpPoint(Vector3 position)
        {
            var behaviour = LocalMapTagPool.Require(LocalMapTag.TagType.JumpPoint);
            tagBehaviours.Add(behaviour);
            var pathPointPos = mapMatrix.WorldToLocalPosition(position);
            behaviour.transform.SetParentEx(m_LocalMapRect, pathPointPos, Quaternion.identity, Vector3.one);
            behaviour.gameObject.SetActive(true);
            behaviour.Display(position);
        }
        private void UpdateHeroPosition()
        {
            if (mapId == PlayerDatas.Instance.baseData.MapID)
System/WorldMap/LocalMapTag.cs
@@ -27,14 +27,24 @@
        int npcId = 0;
        int index = 0;
        Vector3 jumpPoint = Vector3.zero;
        MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
        TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
        FairyLeagueModel fairyLeagueModel { get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); } }
        private void Start()
        {
            if (m_Moveto != null)
            {
                m_Moveto.SetListener(MoveTo);
            }
        }
        public void Display(int npcId, TextColType colorType)
        {
            this.npcId = npcId;
            var config = NPCConfig.Get(this.npcId);
            switch (m_TagType)
            {
                case TagType.Function:
@@ -59,17 +69,19 @@
                case TagType.WayPoint:
                    break;
                case TagType.Boss:
                    m_NpcName.text = config.charName;
                    m_Level.text = Language.Get("HeadUpName_Monster", config.NPCLV);
                    m_NpcName.colorType = colorType;
                    var dangerous = PlayerDatas.Instance.baseData.LV <= config.NPCLV;
                    m_Level.color = UIHelper.GetUIColor(dangerous ? TextColType.Red : TextColType.Green, false);
                    break;
                case TagType.Elite:
                case TagType.Monster:
                    var config = NPCConfig.Get(this.npcId);
                    m_NpcName.text = config.charName;
                    m_NpcName.colorType = colorType;
                    break;
                case TagType.Crystal:
                    this.OnCrystalStateChange(this.npcId);
                    m_Moveto.RemoveAllListeners();
                    m_Moveto.AddListener(MoveTo);
                    PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
                    PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
                    fairyLeagueModel.UpdateWarCrystalEvent -= OnCrystalStateChange;
@@ -78,34 +90,14 @@
            }
        }
        public void Display(int npcId, TextColType colorType, Vector3 _position)
        public void Display(Vector3 position)
        {
            this.npcId = npcId;
            switch (m_TagType)
            {
                case TagType.Boss:
                    var config = NPCConfig.Get(this.npcId);
                    m_NpcName.text = config.charName;
                    m_Level.text = Language.Get("HeadUpName_Monster", config.NPCLV);
                    m_NpcName.colorType = colorType;
                    var dangerous = PlayerDatas.Instance.baseData.LV <= config.NPCLV;
                    m_Level.color = UIHelper.GetUIColor(dangerous ? TextColType.Red : TextColType.Green, false);
                    m_Moveto.SetListener(MoveTo);
                    break;
                default:
                    break;
            }
            jumpPoint = position;
        }
        public void Display(int index)
        {
            this.index = index;
            switch (m_TagType)
            {
                case TagType.FairyLeagueBuff:
                    m_Moveto.SetListener(MoveTo);
                    break;
            }
        }
        public void Dispose()
@@ -159,6 +151,9 @@
                            hero.MoveToPosition(new Vector3(buffPos.x, hero.Pos.y, buffPos.y));
                        }
                    }
                    break;
                case TagType.JumpPoint:
                    MapTransferUtility.Instance.MoveToLocalMapPosition(new Vector3(jumpPoint.x, jumpPoint.z, 0) * 2);
                    break;
                default:
                    {
@@ -233,6 +228,7 @@
            WayPoint = 5,
            Crystal = 6,
            FairyLeagueBuff = 7,
            JumpPoint = 8
        }
    }