private void CreateConnection(ViewStateNode viewStateNode, ViewPageNode viewPageNode)
        {
            viewStateNode.currentLinkedViewPageNode.Add(viewPageNode);
            viewPageNode.currentLinkedViewStateNode = viewStateNode;

            viewStateNode.OnNodeConnect(viewPageNode);
            viewPageNode.OnNodeConnect(viewStateNode);
        }
Пример #2
0
        public override void SetupNode()
        {
            OnNodeTypeConvert(currentLinkedViewStateNode, this);
            currentLinkedViewStateNode = null;
            var isOverlay = nodeType == NodeType.Overlay;

            this.viewPage.viewPageType = isOverlay ? ViewPage.ViewPageType.Overlay : ViewPage.ViewPageType.FullPage;
        }
        public void OnViewStateDelete(ViewStateNode node)
        {
            var s = data.viewStates.SingleOrDefault(m => m.viewState == node.viewState);

            node.currentLinkedViewPageNode.All(
                (m) =>
            {
                m.currentLinkedViewStateNode = null;
                m.viewPage.viewState         = "";
                return(true);
            }
                );
            data.viewStates.Remove(s);
            isDirty = true;
        }
        public void CreateConnection(ViewStateNode viewStateNode)
        {
            if (string.IsNullOrEmpty(viewStateNode.viewState.name))
            {
                return;
            }
            var vps = viewPageList.Where(m => m.viewPage.viewState == viewStateNode.viewState.name);

            if (vps.Count() == 0)
            {
                return;
            }
            foreach (var item in vps)
            {
                CreateConnection(viewStateNode, item);
            }
        }
        public ViewStateNode AddViewStateNode(Vector2 position, ViewState viewState = null)
        {
            var node = new ViewStateNode(position, CheckCanMakeConnect, viewState);

            node.OnNodeSelect += (m) =>
            {
                lastSelectNode = m;
                inspector.SetCurrentSelectItem(m);
            };
            node.OnNodeDelete += () =>
            {
                dataReader.OnViewStateDelete(node);
                viewStateList.Remove(node);
            };

            if (viewState == null)
            {
                dataReader.OnViewStateAdd(node);
            }
            viewStateList.Add(node);
            return(node);
        }
 public void OnViewStateAdd(ViewStateNode node)
 {
     data.viewStates.Add(new ViewSystemSaveData.ViewStateSaveData(new Vector2(node.rect.x, node.rect.y), node.viewState));
     isDirty = true;
 }