IEnumerator AlignElements(AutoAlignmentHelper.AlignmentReference reference) { m_AlignmentHelper.SendAlignCommand(reference); yield return(null); // Get the UI elements m_FirstNode = FirstNodeModel.GetUI <Node>(graphView); m_SecondNode = SecondNodeModel.GetUI <Node>(graphView); m_ThirdNode = ThirdNodeModel.GetUI <Node>(graphView); m_FourthNode = FourthNodeModel.GetUI <Node>(graphView); m_Placemat = PlacematModel.GetUI <Placemat>(graphView); m_StickyNote = StickyNoteModel.GetUI <StickyNote>(graphView); }
IEnumerator SpaceElements(PortOrientation orientation) { m_AutoSpacingHelper.SendSpacingCommand(orientation); yield return(null); // Get the UI elements m_FirstNode = FirstNodeModel.GetUI <Node>(graphView); m_SecondNode = SecondNodeModel.GetUI <Node>(graphView); m_ThirdNode = ThirdNodeModel.GetUI <Node>(graphView); m_FourthNode = FourthNodeModel.GetUI <Node>(graphView); m_Placemat = PlacematModel.GetUI <Placemat>(graphView); m_StickyNote = StickyNoteModel.GetUI <StickyNote>(graphView); }
IEnumerator CreateElements(Vector2 firstNodePos, Vector2 secondNodePos, Vector2 placematPos, Vector2 stickyNotePos, bool smallerSize) { FirstNodeModel = CreateNode("Node1", firstNodePos); SecondNodeModel = CreateNode("Node2", secondNodePos); PlacematModel = CreatePlacemat(new Rect(placematPos, new Vector2(200, smallerSize ? 100 : 200)), "Placemat"); StickyNoteModel = CreateSticky("Sticky", "", new Rect(stickyNotePos, smallerSize ? new Vector2(100, 100) : new Vector2(200, 200))); MarkGraphViewStateDirty(); yield return(null); // Get the UI elements m_FirstNode = FirstNodeModel.GetUI <Node>(graphView); m_SecondNode = SecondNodeModel.GetUI <Node>(graphView); m_Placemat = PlacematModel.GetUI <Placemat>(graphView); m_StickyNote = StickyNoteModel.GetUI <StickyNote>(graphView); Assert.IsNotNull(m_FirstNode); Assert.IsNotNull(m_SecondNode); Assert.IsNotNull(m_Placemat); Assert.IsNotNull(m_StickyNote); }