예제 #1
0
 private void AddSearchWindow(StoryGraph editorWindow)
 {
     _searchWindow = ScriptableObject.CreateInstance <NodeSearchWindow>();
     _searchWindow.Configure(editorWindow, this);
     nodeCreationRequest = context =>
                           SearchWindow.Open(new SearchWindowContext(context.screenMousePosition), _searchWindow);
 }
예제 #2
0
        public StoryGraphView(StoryGraph editorWindow)
        {
            styleSheets.Add(Resources.Load <StyleSheet>("NarrativeGraph"));
            SetupZoom(ContentZoomer.DefaultMinScale, ContentZoomer.DefaultMaxScale);

            this.AddManipulator(new ContentDragger());
            this.AddManipulator(new SelectionDragger());
            this.AddManipulator(new RectangleSelector());
            this.AddManipulator(new FreehandSelector());

            var grid = new GridBackground();

            Insert(0, grid);
            grid.StretchToParentSize();

            AddElement(GetEntryPointNodeInstance());

            AddSearchWindow(editorWindow);
        }