From b5ba48cdbf88fb54f82087564247c1db3de7cf46 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期一, 27 八月 2018 11:52:12 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/WindowBase/Window.cs |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/System/WindowBase/Window.cs b/System/WindowBase/Window.cs
index 0bbcd05..08490aa 100644
--- a/System/WindowBase/Window.cs
+++ b/System/WindowBase/Window.cs
@@ -65,9 +65,20 @@
                 Debug.Log(ex.StackTrace);
             }
 
+            RectTransform parent = null;
             try
             {
                 windowTimer = 0f;
+                var parentName = string.Empty;
+                if (WindowConfig.Get().FindParentWindow(this.gameObject.name, out parentName))
+                {
+                    var parentWindow = WindowCenter.Instance.Get(parentName);
+                    if (parentWindow != null)
+                    {
+                        parent = parentWindow.transform as RectTransform;
+                        rectTransform.MatchWhith(parent);
+                    }
+                }
                 OnPreOpen();
                 WindowCenter.Instance.NotifyBeforeOpen(this);
             }
@@ -77,14 +88,16 @@
             }
             finally
             {
-                var parent = FindParent(windowInfo.windowType);
-
-                if (parent != null)
+                if (parent == null)
                 {
-                    rectTransform.MatchWhith(parent);
-                    if (windowInfo.windowType >= WindowType.Normal)
+                    parent = FindParent(windowInfo.windowType);
+                    if (parent != null)
                     {
-                        rectTransform.SetAsLastSibling();
+                        rectTransform.MatchWhith(parent);
+                        if (windowInfo.windowType >= WindowType.Normal)
+                        {
+                            rectTransform.SetAsLastSibling();
+                        }
                     }
                 }
 

--
Gitblit v1.8.0