示例#1
0
        private void AddRemoveChoose()
        {
            if (GUILayout.Button("Add"))
            {
                CurrentBox.CreateNew();

                SaveCurrentAsset();
                CurrentBox.OnBeforeSerialize();
                _filterViewer.SetLast();
            }

            if (GUILayout.Button("Del "))
            {
                CurrentBox.Remove(_viewerEntity.GetCurrent().Id);
                CurrentBox.OnBeforeSerialize();
                SaveCurrentAsset();
            }
            _filterViewer.DrawSearch();

            if (GUILayout.Button("Ser "))
            {
                CurrentBox.OnBeforeSerialize();
                CurrentBox.SaveToFile();
            }

            if (GUILayout.Button("DESer "))
            {
                CurrentBox.LoadFromFile();
                CurrentBox.Reload();
                this.Repaint();
            }
        }
        protected virtual void OnGUI()
        {
            if (_oldSize != position)
            {
                _oldSize = position;
                _area    = new AreaSizesChooseWindow(this);
                Repaint();
            }

            DrawBtnsElements(_area.BtnsArea);

            DrawAllElements(_area.AllElemntsRect);

            GUILayout.BeginArea(_area.FilterRect);
            {
                FilterViewer.DrawSearch();
                FilterViewer.DrawFilter();
            }

            GUILayout.EndArea();
            DrawCurrentElement(_area.MainRect);
        }