少年修仙传客户端代码仓库
client_Zxw
2018-08-27 767d1f3b6c149729ee614d31fc666592ec279c76
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
4个文件已修改
102 ■■■■■ 已修改文件
Fight/Stage/StageManager.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeWin.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/Window.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI/Common/WindowConfig.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/StageManager.cs
@@ -89,7 +89,7 @@
            }
            else
            {
                SnxxzGame.Instance.StartCoroutine(BackToNoviceVillageWhileMapResourceLacked());
                SnxxzGame.Instance.StartCoroutine(BackToNoviceVillageWhileMapResourceLacked(mapResConfig.ID));
            }
        }
    }
@@ -324,8 +324,9 @@
        SystemSetting.Instance.SetFPSLimit(SystemSetting.Instance.GetFPSLimit());
    }
    IEnumerator BackToNoviceVillageWhileMapResourceLacked()
    IEnumerator BackToNoviceVillageWhileMapResourceLacked(int _mapResId)
    {
        currentMapResId = _mapResId;
        LoadingWin.targetMapResId = 1;
        WindowCenter.Instance.Open<LoadingWin>(true);
System/Compose/New/ComposeWin.cs
@@ -32,6 +32,8 @@
        [SerializeField]
        private FunctionButton _itemUITitleType;
        [SerializeField]
        private FunctionButton _dogzEquipFunc;
        [SerializeField]
        private FunctionButtonGroup _funcBtnGroup;
        #endregion
@@ -54,12 +56,12 @@
            _godequipUITitleType.onClick.AddListener(OnClickGodEquipCompose);
            _equipUITitleType.onClick.AddListener(OnClickEquipCompose);
            _itemUITitleType.onClick.AddListener(OnClickItemCompose);
            _dogzEquipFunc.AddListener(ClickDogzEquipCompose);
            _prePageBtn.onClick.AddListener(OnClickLeftBtn);
            _nextPageBtn.onClick.AddListener(OnClickRightBtn);
            _closeBtn.onClick.AddListener(OnClickCloseBtn);
        }
        protected override void OnPreOpen()
        {
            ComposeModel.ResetModel();
@@ -141,6 +143,22 @@
            _funcBtnGroup.TriggerLast();
        }
        private void ClickDogzEquipCompose()
        {
            CloseSubWindows();
            if (windowState == WindowState.Opened)
            {
                WindowCenter.Instance.OpenWithoutAnimation<ComposeDogzEquipWin>();
            }
            else
            {
                WindowCenter.Instance.Open<ComposeDogzEquipWin>();
            }
            functionOrder = _dogzEquipFunc.order;
        }
        private void OnClickItemCompose()
        {
            
@@ -218,6 +236,7 @@
            WindowCenter.Instance.CloseImmediately<ComposeEquipWin>();
            WindowCenter.Instance.CloseImmediately<ComposeToolsWin>();
            WindowCenter.Instance.CloseImmediately<ComposeWingsWin>();
            WindowCenter.Instance.CloseImmediately<ComposeDogzEquipWin>();
        }
        public void OnClickCloseBtn()
System/WindowBase/Window.cs
@@ -38,6 +38,7 @@
        }
        public bool playAnimation { get; set; }
        public bool executedActiveWindow { get; set; }
        internal Window Open()
        {
@@ -65,6 +66,7 @@
                Debug.Log(ex.StackTrace);
            }
            executedActiveWindow = false;
            RectTransform parent = null;
            try
            {
@@ -151,6 +153,7 @@
                windowState = WindowState.Closing;
            }
            executedActiveWindow = false;
            return this;
        }
@@ -207,6 +210,7 @@
            try
            {
                OnAfterClose();
                executedActiveWindow = false;
            }
            catch (System.Exception ex)
            {
@@ -237,6 +241,11 @@
        public virtual void CloseClick()
        {
            CloseImmediately();
        }
        public void ChildActive()
        {
            OnActived();
        }
        protected virtual void LateUpdate()
@@ -350,6 +359,7 @@
                    try
                    {
                        OnAfterClose();
                        executedActiveWindow = false;
                    }
                    catch (System.Exception ex)
                    {
@@ -400,6 +410,7 @@
                try
                {
                    OnAfterClose();
                    executedActiveWindow = false;
                }
                catch (System.Exception ex)
                {
@@ -439,7 +450,37 @@
            try
            {
                OnActived();
                var isChildWindow = WindowConfig.Get().IsChildWindow(this.gameObject.name);
                if (isChildWindow)
                {
                    var parentName = string.Empty;
                    WindowConfig.Get().FindParentWindow(this.gameObject.name, out parentName);
                    var parentWindow = WindowCenter.Instance.Get(parentName);
                    if (parentWindow != null && parentWindow.executedActiveWindow)
                    {
                        OnActived();
                        executedActiveWindow = true;
                    }
                }
                else
                {
                    OnActived();
                    executedActiveWindow = true;
                    var childWindows = WindowConfig.Get().FindChildWindows(this.gameObject.name);
                    var isParentWindow = childWindows != null;
                    if (isParentWindow)
                    {
                        foreach (var child in childWindows)
                        {
                            var window = WindowCenter.Instance.Get(child);
                            if (window != null && !window.executedActiveWindow)
                            {
                                window.ChildActive();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
UI/Common/WindowConfig.cs
@@ -7,7 +7,9 @@
public class WindowConfig : ScriptableObject
{
    public WindowTable[] windows;
    public WindowTable[] windows;
    public Dictionary<string, List<string>> parentChildrenTable = new Dictionary<string, List<string>>();
    public List<string> childWindows = new List<string>();
    static WindowConfig config;
    public static WindowConfig Get()
@@ -15,11 +17,21 @@
        if (config == null)
        {
            config = Resources.Load<WindowConfig>("ScriptableObject/Config/WindowConfig");
            for (int i = 0; i < config.windows.Length; i++)
            {
                var table = config.windows[i];
                var children = config.parentChildrenTable[table.parent] = new List<string>();
                for (int j = 0; j < table.orderTables.Length; j++)
                {
                    children.Add(table.orderTables[j].window);
                }
                config.childWindows.AddRange(children);
            }
        }
        return config;
    }
    public bool FindChildWindow(string _parent, int _order, out string _child)
    {
@@ -63,6 +75,23 @@
        return false;
    }
    public List<string> FindChildWindows(string _parent)
    {
        if (parentChildrenTable.ContainsKey(_parent))
        {
            return parentChildrenTable[_parent];
        }
        else
        {
            return null;
        }
    }
    public bool IsChildWindow(string _name)
    {
        return childWindows.Contains(_name);
    }
    [Serializable]
    public struct WindowTable
    {