예제 #1
0
        void DrawControllerListWnd()
        {
            var stackMng = CSCommonEditor.GetField<StackManager>(UIManager.Instance, "mStackInstance");
            if (stackMng == null)
                return;
            var listWnd = CSCommonEditor.GetField<List<StackData>>(stackMng, "mListWindow");

            List<StackData> temp = new List<StackData>(listWnd);

            CSCommonEditor.DrawHeader("Window Info");

            //  Titile
            GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f));
            GUI.contentColor = Color.green;
            GUILayout.Label("Order", GUILayout.Width(50f));
            GUILayout.Label("Instance", GUILayout.MinWidth(100f));
            GUILayout.Label("S-Depth", GUILayout.Width(70f));
            GUILayout.Label("E-Depth", GUILayout.Width(70f));
            GUI.contentColor = Color.white;
            GUILayout.EndHorizontal();

            if (temp.Count == 0)
            {
                EditorGUILayout.HelpBox("No Windows ! ", MessageType.Info);
                return;
            }
            else
            {
                switch (controllerSortType)
                {
                    default:
                    case CtlSortWnd.Order: break;
                    case CtlSortWnd.Depth:
                        temp.Sort((StackData l, StackData r) => { return l.mStartDepth.CompareTo(r.mStartDepth); });
                        break;
                }

                GUILayout.Space(5f);

                controllerSortType = (CtlSortWnd)EditorGUILayout.EnumPopup(controllerSortType);

                GUILayout.Space(5f);

                StackData data = null;
                ctlScrollPos1 = GUILayout.BeginScrollView(ctlScrollPos1);
                for (int i = 0; i < temp.Count; i++)
                {
                    data = temp[i];

                    GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f));
                    GUILayout.Label(data.mOrder.ToString(), GUILayout.Width(50f));
                    EditorGUILayout.ObjectField(data.mObject, typeof(GameObject), GUILayout.MinWidth(100f));
                    EditorGUILayout.LabelField(data.mStartDepth.ToString(), GUILayout.Width(70f));
                    EditorGUILayout.LabelField(data.mEndDepth.ToString(), GUILayout.Width(70f));
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndScrollView();
            }

        }