Example #1
0
        private void _InitRegion()
        {
            if (m_quadtree == null)
            {
                return;
            }
            m_lstRegions.Clear();
            //m_lstIgnore.Clear();

            m_leaves = m_quadtree.GetAllLeaves();

            for (int i = 0; i < m_leaves.Count; ++i)
            {
                QuadtreeLeaf leaf = m_leaves[i];

                CombineRegion combineRegion = new CombineRegion();
                combineRegion.Init();

                for (int j = 0, count = leaf.objects.Count; j < count; ++j)
                {
                    CombineMeshData data = new CombineMeshData(leaf.objects[j]);
                    combineRegion.AddCombineData(data);
                }
                m_lstRegions.Add(combineRegion);
            }
        }
        private void _ShowMapRect()
        {
            GUILayout.BeginVertical(GUILayout.Width(nRow * m_nButtonWidth));

            if (bShowMapRect)
            {
                GUILayout.BeginVertical("Box", GUILayout.Width(nRow * m_nButtonWidth));
                for (int i = 0; i < nRow; ++i)
                {
                    GUILayout.BeginHorizontal();
                    for (int j = 0; j < nRow; ++j)
                    {
                        int           nIndex = nRow * i + j;
                        CombineRegion region = m_regions[nIndex];
                        if (region.HasData())
                        {
                            m_styleButton.normal.textColor = region.bSelect ? Color.green : Color.white;
                            if (GUILayout.Button(nIndex.ToString(), m_styleButton, GUILayout.Width(m_nButtonWidth), GUILayout.Height(m_nButtonWidth)))
                            {
                                /*
                                 * region.bSelect = !region.bSelect;
                                 * _RefreshSelectRegions();
                                 * _RefreshSelectObj();*/
                            }
                        }
                        else
                        {
                            m_styleLabel.alignment = TextAnchor.MiddleCenter;
                            GUILayout.Label("Empty", m_styleLabel, GUILayout.Width(m_nButtonWidth), GUILayout.Height(m_nButtonWidth));
                        }
                    }
                    GUILayout.EndHorizontal();
                }

                GUILayout.EndVertical();
            }

            _ShowMaterialList();

            GUILayout.EndVertical();
        }