少年修仙传客户端代码仓库
client_Zxw
2019-02-20 e3f8216b5af8e0726b7e818a4a5062f38bce1e77
3335 主界面修改
2个文件已修改
298 ■■■■ 已修改文件
System/MainInterfacePanel/MainInterfaceWin.cs 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/MainPositionTween.cs 105 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/MainInterfaceWin.cs
@@ -29,13 +29,8 @@
        [SerializeField] IsShowXpButton m_IsShowXp;//XP 技能常显                                                
        [SerializeField] SkillButtonEffects m_SkillButtonEffects;
        [Header("副本面板移动速度")]
        public float CopyOfThePanelSpeed = 1f;//副本面板移动速度
        [SerializeField] Transform CopyOfThePanel;
        [SerializeField] Transform m_ContainerBossList;
        [SerializeField] DungeonBossBriefInfoContainer m_BossBriefInfos;
        [SerializeField] Transform CopyOfThePosition1;
        [SerializeField] Transform CopyOfThePosition2;
        [SerializeField] IntensifySmoothSlider _ExpSlider;//经验条
        [SerializeField] Button _DownButton;//查看经验数值
@@ -99,7 +94,6 @@
        public static event Action<bool> IsCopyOfThePanel;
        public static event Action IsOpenMaininterface;
        public static bool CopyOfThePositionBool = true;
        RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
        PlayerMountDatas horsemodel { get { return ModelCenter.Instance.GetModel<PlayerMountDatas>(); } }
@@ -241,16 +235,7 @@
                }
                if (mapId != PlayerDatas.Instance.baseData.MapID)
                {
                    CopyOfThePanel.localPosition = CopyOfThePosition2.localPosition;
                    onMainModel.MainTopPanelShow = false;
                    CopyOfThePositionBool = false;
                    m_ContainerBossList.localPosition = CopyOfThePosition1.localPosition;
                    m_BossBriefInfos.Unfold(false);
                    if (Event_Duplicates != null)
                    {
                        Event_Duplicates(false, CopyOfThePanelSpeed);
                    }
                    SetTipPanelOrBossList(false,false);
                }
                if (m_AnimationFadeOut.GetIsFadeIn() && mapId != PlayerDatas.Instance.baseData.MapID)
                {
@@ -293,37 +278,15 @@
                {
                    if (mapId != PlayerDatas.Instance.baseData.MapID)
                    {
                        CopyOfThePanel.localPosition = CopyOfThePosition2.localPosition;
                        onMainModel.MainTopPanelShow = false;
                        if (IsCopyOfThePanel != null)
                        {
                            IsCopyOfThePanel(false);
                        }
                        CopyOfThePositionBool = false;
                        m_ContainerBossList.localPosition = CopyOfThePosition1.localPosition;
                        m_BossBriefInfos.Unfold(false);
                        SetTipPanelOrBossList(false, false);
                    }
                }
                else
                {
                    if (!IsBossBool)
                    {
                        CopyOfThePanel.localPosition = CopyOfThePosition1.localPosition;
                        onMainModel.MainTopPanelShow = true;
                        CopyOfThePositionBool = true;
                        m_ContainerBossList.localPosition = CopyOfThePosition2.localPosition;
                        m_BossBriefInfos.Unfold(false);
                        SetTipPanelOrBossList(true,false);
                    }
                }
                if (Event_Duplicates != null && (inDungeon || isNeutralMap))
                {
                    Event_Duplicates(true, CopyOfThePanelSpeed);
                }
                if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) < 2)
                {
                    CopyOfThePositionBool = true;
                    m_ContainerBossList.localPosition = CopyOfThePosition2.localPosition;
                }
                m_FunctionForecastTip.gameObject.SetActive(true);
            }
@@ -434,7 +397,7 @@
                    TaskSwithButton();
                    onMainModel.IsBossAreaTask = true;
                }
                if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) < 5)
                if (m_MainPositionTween.IsSetCopyOfThePanelShow)
                {
                    if (NewBieCenter.Instance.inGuiding)
                    {
@@ -457,16 +420,9 @@
            if (_areaType == MapArea.E_Type.Boss && !_enter)
            {
                if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon && !isNeutralMap)
                if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon && !isNeutralMap)
                {
                    CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
                    onMainModel.MainTopPanelShow = true;
                    if (IsCopyOfThePanel != null)
                    {
                        IsCopyOfThePanel(true);
                    }
                    m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
                    m_BossBriefInfos.Unfold(false);
                    SetTipPanelOrBossList(true,true);
                }
            }
        }
@@ -573,30 +529,13 @@
            {
                if (inDungeon || IsBossBool || isNeutralMap)
                {
                    if (IsCopyOfThePanel != null)
                    {
                        IsCopyOfThePanel(false);
                    }
                    if (Event_Duplicates != null && inDungeon)
                    {
                        Event_Duplicates(false, CopyOfThePanelSpeed);
                    }
                    onMainModel.MainTopPanelShow = false;
                    CopyOfThePanel.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
                    m_ContainerBossList.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
                    m_BossBriefInfos.Unfold(false);
                    SetTipPanelOrBossList(false,true);
                }
                if (!IsBossBool)
                {
                    if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon)
                    if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon)
                    {
                        if (IsCopyOfThePanel != null)
                        {
                            IsCopyOfThePanel(true);
                        }
                        CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
                        m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
                        m_BossBriefInfos.Unfold(false);
                        SetTipPanelOrBossList(true,true);
                    }
                }
                m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
@@ -660,32 +599,13 @@
            {
                if (inDungeon || IsBossBool || isNeutralMap)
                {
                    CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
                    onMainModel.MainTopPanelShow = true;
                    if (IsCopyOfThePanel != null)
                    {
                        IsCopyOfThePanel(true);
                    }
                    m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
                    m_BossBriefInfos.Unfold(false);
                    if (Event_Duplicates != null && inDungeon)
                    {
                        Event_Duplicates(true, CopyOfThePanelSpeed);
                    }
                    SetTipPanelOrBossList(true,true);
                }
                if (!IsBossBool)
                {
                    if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon)
                    if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon)
                    {
                        CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
                        onMainModel.MainTopPanelShow = true;
                        if (IsCopyOfThePanel != null)
                        {
                            IsCopyOfThePanel(true);
                        }
                        m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
                        m_BossBriefInfos.Unfold(false);
                        SetTipPanelOrBossList(true, true);
                    }
                }
                m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed);
@@ -699,32 +619,14 @@
            {
                if (inDungeon || IsBossBool || isNeutralMap)
                {
                    CopyOfThePanel.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
                    onMainModel.MainTopPanelShow = false;
                    if (IsCopyOfThePanel != null)
                    {
                        IsCopyOfThePanel(false);
                    }
                    m_ContainerBossList.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
                    m_BossBriefInfos.Unfold(false);
                    if (Event_Duplicates != null && inDungeon)
                    {
                        Event_Duplicates(false, CopyOfThePanelSpeed);
                    }
                    SetTipPanelOrBossList(false,true);
                }
                if (!IsBossBool)
                {
                    if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon)
                    if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon)
                    {
                        CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
                        if (IsCopyOfThePanel != null)
                        {
                            IsCopyOfThePanel(true);
                        }
                        m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
                        m_BossBriefInfos.Unfold(false);
                    }
                        SetTipPanelOrBossList(true, true);
                    }
                }
                m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
                m_CastSkillTip.DOLocalMoveX(m_position1_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed);
@@ -837,16 +739,9 @@
                    TaskSwithButton();
                    onMainModel.IsBossAreaTask = false;
                }
                if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2)//上层面板
                if (!m_MainPositionTween.IsSetCopyOfThePanelShow)//上层面板
                {
                    CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
                    onMainModel.MainTopPanelShow = true;
                    m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
                    m_BossBriefInfos.Unfold(false);
                    if (IsCopyOfThePanel != null)
                    {
                        IsCopyOfThePanel(true);
                    }
                    SetTipPanelOrBossList(true,true);
                }
                m_HighSettingTip.ShowButtonNow();
            }
@@ -999,10 +894,50 @@
                }
            }
        }
        private void SetTipPanelOrBossList(bool _bool,bool _isTween)//顶层按钮组和boss列表的相互切换
        {
            var inDungeon = IsDungeon();
            m_BossBriefInfos.Unfold(false);
            if (_bool)
            {
                if (IsCopyOfThePanel != null)
                {
                    IsCopyOfThePanel(true);
                }
                if (Event_Duplicates != null && inDungeon)
                {
                    Event_Duplicates(true, m_MainPositionTween.CopyOfThePanelSpeed);
                }
                onMainModel.MainTopPanelShow = true;
                if (_isTween)
                {
                    m_MainPositionTween.SetTipAndBossTweenPos(true);
                }
                else
                {
                    m_MainPositionTween.SetTipAndBossPos(true);
                }
            }
            else
            {
                if (IsCopyOfThePanel != null)
                {
                    IsCopyOfThePanel(false);
                }
                if (Event_Duplicates != null && inDungeon)
                {
                    Event_Duplicates(false, m_MainPositionTween.CopyOfThePanelSpeed);
                }
                onMainModel.MainTopPanelShow = false;
                if (_isTween)
                {
                    m_MainPositionTween.SetTipAndBossTweenPos(false);
                }
                else
                {
                    m_MainPositionTween.SetTipAndBossPos(false);
                }
            }
        }
    }
}
}
System/MainInterfacePanel/MainPositionTween.cs
@@ -14,40 +14,89 @@
    {
        [Header("主界面顶部上下切换按钮组")]
        public float CopyOfThePanelSpeed = 1f;//副本面板移动速度
        [SerializeField] Transform CopyOfThePanel;
        [SerializeField] Transform CopyOfThePosition1;
        [SerializeField] Transform CopyOfThePosition2;
        [SerializeField] Transform m_CopyOfThePanel;
        [SerializeField] Transform m_CopyOfThePosition1;
        [SerializeField] Transform m_CopyOfThePosition2;
        [SerializeField] Transform m_ContainerBossList;
        public void SetCopyOfThePanelPos(bool show)
        {
            if (show)
            {
                CopyOfThePanel.localPosition = CopyOfThePosition1.localPosition;
            }
            else
            {
                CopyOfThePanel.localPosition = CopyOfThePosition2.localPosition;
            }
        }
        public void SetCopyOfThePanelTweenPos(bool show)
        {
            if (show)
            {
                CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
            }
            else
            {
                CopyOfThePanel.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
            }
        }
        public bool IsSetCopyOfThePanelShow
        {
            get
            {
                return (CopyOfThePanel.position - CopyOfThePosition1.position).sqrMagnitude > (2.5 * 2.5);
            {
                return (m_CopyOfThePanel.position - m_CopyOfThePosition1.position).sqrMagnitude < (2.5 * 2.5);
            }
        }
        public void SetCopyOfThePanelPos(bool _bool)
        {
            if (_bool)
            {
                m_CopyOfThePanel.localPosition = m_CopyOfThePosition1.localPosition;
            }
            else
            {
                m_CopyOfThePanel.localPosition = m_CopyOfThePosition2.localPosition;
            }
        }
        public void SetCopyOfThePanelTweenPos(bool _bool)
        {
            if (_bool)
            {
                m_CopyOfThePanel.DOLocalMoveY(m_CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
            }
            else
            {
                m_CopyOfThePanel.DOLocalMoveY(m_CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
            }
        }
        public void SetBossListPos(bool _bool)
        {
            if (_bool)
            {
                m_ContainerBossList.localPosition = m_CopyOfThePosition1.localPosition;
            }
            else
            {
                m_ContainerBossList.localPosition = m_CopyOfThePosition2.localPosition;
            }
        }
        public void SetBossListTweenPos(bool _bool)
        {
            if (_bool)
            {
                m_ContainerBossList.DOLocalMoveY(m_CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
            }
            else
            {
                m_ContainerBossList.DOLocalMoveY(m_CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
            }
        }
        public void SetTipAndBossPos(bool _bool)
        {
            if (_bool)
            {
                SetCopyOfThePanelPos(true);
                SetBossListPos(false);
            }
            else
            {
                SetCopyOfThePanelPos(false);
                SetBossListPos(true);
            }
        }
        public void SetTipAndBossTweenPos(bool _bool)
        {
            if (_bool)
            {
                SetCopyOfThePanelTweenPos(true);
                SetBossListTweenPos(false);
            }
            else
            {
                SetCopyOfThePanelTweenPos(false);
                SetBossListTweenPos(true);
            }
        }
    }
}