public void RefreshData(bool hardRefresh = true)
        {
            ClearEditor();
            EditMode   = false;
            dataReader = new ViewSystemDataReaderV2(this);
            isInit     = dataReader.Init();
            saveData   = ((ViewSystemDataReaderV2)dataReader).GetSaveData();
            inspector  = new ViewSystemNodeInspector(this);
            //ViewControllerRoot = ((ViewSystemDataReaderV2)dataReader).GetViewControllerRoot();
            globalSettingWindow = new ViewSystemGlobalSettingWindow("Global Setting", this, (ViewSystemDataReaderV2)dataReader);
            viewPageOrderWindow = new ViewPageOrderWindow("Overlay Order", this, (ViewSystemDataReaderV2)dataReader);
            overridePopupWindow = new OverridePopupWindow("Override", this, inspector);
            navigationWindow    = new ViewPageNavigationWindow("Navigation Setting", this);
            viewSystemVerifier  = new ViewSystemVerifier(this, saveData);
            breakpointWindow    = new ViewBreakpointWindow("Break Point Setting", this);
            viewStatesPopup.Add("All");
            viewStatesPopup.Add("Overlay Only");
            viewStatesPopup.AddRange(viewStateList.Select(m => m.viewState.name));

            if (hardRefresh == false && lastSelectNode != null)
            {
                inspector.SetCurrentSelectItem(lastSelectNode);
            }
            dataReader.EditEnd();
            CanEnterEditMode = true;
        }
        public OverridePopupWindow(string name, ViewSystemVisualEditor editor, ViewSystemNodeInspector sideBar)
            : base(name, editor)
        {
            this.sideBar      = sideBar;
            removeButtonStyle = new GUIStyle
            {
                fixedWidth = 25f,
                active     =
                {
                    background = CMEditorUtility.CreatePixelTexture("Dark Pixel (List GUI)", new Color32(100, 100, 100, 255))
                },
                imagePosition = ImagePosition.ImageOnly,
                alignment     = TextAnchor.MiddleCenter
            };

            resizeable = true;
        }
        private void ProcessEvents(Event e)
        {
            drag = Vector2.zero;
            switch (e.type)
            {
            case EventType.MouseDrag:
                if (e.button == 2)
                {
                    if (scriptViewRect.Contains(e.mousePosition))
                    {
                        OnDrag(e.delta * 1 / zoomScale);
                    }
                }
                break;

            case EventType.ScrollWheel:
                Vector2 zoomCenter;
                zoomCenter.x = e.mousePosition.x / zoomScale / nodeViewContianer.contentRect.width;
                zoomCenter.y = e.mousePosition.y / zoomScale / nodeViewContianer.contentRect.height;
                zoomCenter  *= zoomScale;
                DoZoom(-e.delta.y * 0.01f, zoomCenter);
                e.Use();
                break;

            case EventType.MouseDown:

                if (e.button == 1)
                {
                    if (ViewSystemNodeInspector.isMouseInSideBar() && inspector.show)
                    {
                        return;
                    }
                    if (!nodeViewContianer.contentRect.Contains(e.mousePosition))
                    {
                        return;
                    }
                    GenericMenu genericMenu = new GenericMenu();

                    genericMenu.AddItem(new GUIContent("Add FullPage"), false,
                                        () =>
                    {
                        Vector2 pos        = new Vector2(e.mousePosition.x - inspectorContianer.contentRect.width, e.mousePosition.y - menuBarHeight);
                        Vector2 unScalePos = new Vector2(-ViewSystemNode.ViewSystemNodeWidth * 0.5f, -ViewSystemNode.ViewPageNodeHeight * .5f);
                        AddViewPageNode((pos * 1 / zoomScale + unScalePos) - viewPortScroll, false);
                    }
                                        );
                    genericMenu.AddItem(new GUIContent("Add OverlayPage"), false,
                                        () =>
                    {
                        Vector2 pos        = new Vector2(e.mousePosition.x - inspectorContianer.contentRect.width, e.mousePosition.y - menuBarHeight);
                        Vector2 unScalePos = new Vector2(-ViewSystemNode.ViewSystemNodeWidth * 0.5f, -ViewSystemNode.ViewPageNodeHeight * .5f);
                        AddViewPageNode((pos * 1 / zoomScale + unScalePos) - viewPortScroll, true);
                    }
                                        );
                    genericMenu.AddItem(new GUIContent("Add ViewState"), false,
                                        () =>
                    {
                        Vector2 pos        = new Vector2(e.mousePosition.x - inspectorContianer.contentRect.width, e.mousePosition.y - menuBarHeight);
                        Vector2 unScalePos = new Vector2(-ViewSystemNode.ViewSystemNodeWidth * 0.5f, -ViewSystemNode.ViewStateNodeHeight * .5f);
                        AddViewStateNode((pos * 1 / zoomScale + unScalePos) - viewPortScroll);
                    }
                                        );
                    genericMenu.ShowAsContext();
                }
                break;
            }
        }