少年修仙传客户端代码仓库
client_linchunjie
2019-05-17 f3eb6c4bc056331b63978183e9b678a2095a3731
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2个文件已修改
54 ■■■■■ 已修改文件
System/MainWin/HighSettingFadeInFadeOut.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainWin/MainWinTopGrid.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainWin/HighSettingFadeInFadeOut.cs
@@ -29,6 +29,7 @@
        State state = State.Closed;
        float closeTimer = 0f;
        int openedFunctionCount = 0;
        TreasureFindHostModel hostModel { get { return ModelCenter.Instance.GetModel<TreasureFindHostModel>(); } }
        LimitedTimePackageItemClassModel limitedTimePackageItemModel { get { return ModelCenter.Instance.GetModel<LimitedTimePackageItemClassModel>(); } }
@@ -38,6 +39,9 @@
        void Start()
        {
            m_Switch.SetListener(() => { Switch(state == State.Closed); });
            openedFunctionCount = 0;
            openedFunctionCount += CountOpenedFunction(m_GridGroup1);
            openedFunctionCount += CountOpenedFunction(m_GridGroup2);
            SwitchImmedidately(false);
        }
@@ -80,7 +84,7 @@
            var index = 0;
            foreach (var grid in m_GridGroup1)
            {
                if (!grid.alwayShow)
                if (!grid.alwayShow && openedFunctionCount > 5)
                {
                    grid.Switch(active, 0, 0f);
                }
@@ -94,7 +98,7 @@
            index = 0;
            foreach (var grid in m_GridGroup2)
            {
                if (!grid.alwayShow)
                if (!grid.alwayShow && openedFunctionCount > 5)
                {
                    var offset = (index / 6) + 1;
                    grid.Switch(active, offset * (m_GridSize.y + m_Space.y), offset * 0.1f);
@@ -118,7 +122,11 @@
        {
            foreach (var grid in m_GridGroup1)
            {
                if (!grid.alwayShow)
                if (grid.alwayShow || openedFunctionCount <= 5)
                {
                    grid.SwitchImmediately(true, 0);
                }
                else
                {
                    grid.SwitchImmediately(active, 0);
                }
@@ -127,7 +135,11 @@
            var index = 0;
            foreach (var grid in m_GridGroup2)
            {
                if (!grid.alwayShow)
                if (grid.alwayShow || openedFunctionCount <= 5)
                {
                    grid.SwitchImmediately(true, ((index / 6) + 1) * (m_GridSize.y + m_Space.y));
                }
                else
                {
                    grid.SwitchImmediately(active, ((index / 6) + 1) * (m_GridSize.y + m_Space.y));
                }
@@ -210,6 +222,10 @@
        private void RefreshGridsActiveState()
        {
            openedFunctionCount = 0;
            openedFunctionCount += CountOpenedFunction(m_GridGroup1);
            openedFunctionCount += CountOpenedFunction(m_GridGroup2);
            ActiveGroup(m_GridGroup1);
            ActiveGroup(m_GridGroup2);
            LayoutGroup(m_GridGroup1, m_GroupContainer1);
@@ -220,6 +236,11 @@
        bool IsShowButton()
        {
            if (openedFunctionCount <= 5)
            {
                return false;
            }
            foreach (var grid in m_GridGroup1)
            {
                if (!grid.alwayShow && grid.gameObject.activeSelf)
@@ -261,6 +282,18 @@
            m_ArrowClose.gameObject.SetActive(state == State.Closed);
        }
        int CountOpenedFunction(MainWinTopGrid[] grids)
        {
            var count = 0;
            foreach (var grid in grids)
            {
                var active = grid.IsOpen();
                count += active ? 1 : 0;
            }
            return count;
        }
        void ActiveGroup(MainWinTopGrid[] grids)
        {
            foreach (var grid in grids)
@@ -271,6 +304,11 @@
                    grid.gameObject.SetActive(true);
                }
                if (grid.gameObject.activeSelf && (grid.alwayShow || openedFunctionCount <= 5))
                {
                    grid.SwitchImmediately(true, 0);
                }
                if (!active && grid.gameObject.activeSelf)
                {
                    grid.gameObject.SetActive(false);
System/MainWin/MainWinTopGrid.cs
@@ -28,14 +28,6 @@
        float targetY = 0f;
        float targetAlpha = 0f;
        private void OnEnable()
        {
            if (m_AlwayShow)
            {
                SwitchImmediately(true, 0);
            }
        }
        public void Switch(bool active, float offset, float delay)
        {
            if (m_AlwayShow)