コード例 #1
0
ファイル: PickingData.cs プロジェクト: yaoya/UnityDecompiled
        internal static string GetName(UIElementsDebugger.ViewPanel viewPanel)
        {
            HostView hostView = viewPanel.View as HostView;
            string   name;

            if (hostView != null)
            {
                EditorWindow actualView = hostView.actualView;
                if (actualView != null)
                {
                    if (!string.IsNullOrEmpty(actualView.name))
                    {
                        name = actualView.name;
                        return(name);
                    }
                    name = actualView.GetType().Name;
                    return(name);
                }
                else if (!string.IsNullOrEmpty(hostView.name))
                {
                    name = hostView.name;
                    return(name);
                }
            }
            name = viewPanel.Panel.visualTree.name;
            return(name);
        }
コード例 #2
0
ファイル: PickingData.cs プロジェクト: yaoya/UnityDecompiled
        public void Refresh()
        {
            this.m_Panels.Clear();
            Dictionary <int, Panel> .Enumerator it = UIElementsUtility.GetPanelsIterator();
            List <GUIView> list = new List <GUIView>();

            GUIViewDebuggerHelper.GetViews(list);
            bool flag = false;
            Rect rect = new Rect(3.40282347E+38f, 3.40282347E+38f, 0f, 0f);

            while (it.MoveNext())
            {
                GUIView gUIView = list.FirstOrDefault(delegate(GUIView v)
                {
                    int arg_19_0 = v.GetInstanceID();
                    KeyValuePair <int, Panel> current2 = it.Current;
                    return(arg_19_0 == current2.Key);
                });
                if (!(gUIView == null))
                {
                    List <UIElementsDebugger.ViewPanel> arg_A6_0 = this.m_Panels;
                    UIElementsDebugger.ViewPanel        item     = default(UIElementsDebugger.ViewPanel);
                    KeyValuePair <int, Panel>           current  = it.Current;
                    item.Panel = current.Value;
                    item.View  = gUIView;
                    arg_A6_0.Add(item);
                    if (rect.xMin > gUIView.screenPosition.xMin)
                    {
                        rect.xMin = gUIView.screenPosition.xMin;
                    }
                    if (rect.yMin > gUIView.screenPosition.yMin)
                    {
                        rect.yMin = gUIView.screenPosition.yMin;
                    }
                    if (rect.xMax < gUIView.screenPosition.xMax || !flag)
                    {
                        rect.xMax = gUIView.screenPosition.xMax;
                    }
                    if (rect.yMax < gUIView.screenPosition.yMax || !flag)
                    {
                        rect.yMax = gUIView.screenPosition.yMax;
                    }
                    flag = true;
                }
            }
            this.m_Labels    = new GUIContent[this.m_Panels.Count + 1];
            this.m_Labels[0] = EditorGUIUtility.TrTextContent("Select a panel", null, null);
            for (int i = 0; i < this.m_Panels.Count; i++)
            {
                this.m_Labels[i + 1] = new GUIContent(PickingData.GetName(this.m_Panels[i]));
            }
            this.screenRect = rect;
        }
コード例 #3
0
        internal static string GetName(UIElementsDebugger.ViewPanel viewPanel)
        {
            var hostview = viewPanel.View as HostView;

            if (hostview != null)
            {
                var win = hostview.actualView;
                if (win != null)
                {
                    if (!String.IsNullOrEmpty(win.name))
                    {
                        return(win.name);
                    }
                    return(win.GetType().Name);
                }
                if (!String.IsNullOrEmpty(hostview.name))
                {
                    return(hostview.name);
                }
            }
            return(viewPanel.Panel.visualTree.name);
        }