UnityEditor.SketchUpDataSource.FetchEnableNodes C# (CSharp) Method

FetchEnableNodes() public method

public FetchEnableNodes ( ) : int[]
return int[]
        public int[] FetchEnableNodes()
        {
            List<int> enable = new List<int>();
            this.InternalFetchEnableNodes(base.m_RootItem as SketchUpNode, enable);
            return enable.ToArray();
        }

Usage Example

Ejemplo n.º 1
0
        void OnGUI()
        {
            Rect rect            = new Rect(0, 0, position.width, position.height);
            int  keyboardControl = GUIUtility.GetControlID(FocusType.Keyboard, rect);

            // Header
            Rect headerRect = new Rect(0, 0, position.width, kHeaderHeight);

            GUI.Label(headerRect, string.Empty, Styles.styles.headerStyle);
            GUI.Label(new Rect(10, 2, position.width, kHeaderHeight), Styles.styles.nodesLabel);

            Rect bottomRect = new Rect(rect.x, rect.yMax - kBottomHeight, rect.width, kBottomHeight);

            // Footer
            GUILayout.BeginArea(bottomRect);
            GUILayout.BeginHorizontal(Styles.styles.footerStyle);
            GUILayout.FlexibleSpace();
            bool closeWindow = false;

            if (isModal)
            {
                if (GUILayout.Button(Styles.styles.okButton))
                {
                    closeWindow = true;
                }
            }
            else
            {
                if (GUILayout.Button(Styles.styles.cancelButton))
                {
                    closeWindow = true;
                }
                else if (GUILayout.Button(Styles.styles.okButton))
                {
                    closeWindow = true;
                    if (m_ModelEditor.IsAlive)
                    {
                        SketchUpImporterModelEditor modelEditor = m_ModelEditor.Target as SketchUpImporterModelEditor;
                        modelEditor.SetSelectedNodes(m_DataSource.FetchEnableNodes());
                    }
                }
            }

            GUILayout.Space(10);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            // TreeView
            rect.y       = kHeaderHeight;
            rect.height -= headerRect.height + bottomRect.height;
            m_TreeView.OnEvent();
            m_TreeView.OnGUI(rect, keyboardControl);

            HandleKeyboardEvents();
            if (closeWindow)
            {
                Close();
            }
        }