Beispiel #1
0
        public void Initialize(SerializedSceneManager serializedManager,
                               SceneManagerEditorWindow editorWindow)
        {
            SerializedManager = serializedManager;
            this.editorWindow = editorWindow;

            NodeEditor.ClearAll();
            NodeEditor.ClearInputModes();

            NodeEditor.CanDeleteNode = CanDeleteNode;

            NodeEditor.OnNodeRemoved      += NodeEditor_OnNodeRemoved;
            NodeEditor.OnConnectorRemoved += NodeEditor_OnConnectorRemoved;

            NodeEditor.OnSelectionChanged += NodeEditor_OnSelectionChanged;

            new DefaultInputModeConfig().ApplyToNodeEditor(NodeEditor);

            ConnectNodeInputMode nodeConnectorMode = NodeEditor.GetInputMode <ConnectNodeInputMode>();

            nodeConnectorMode.ConnectorFactory        = TransitionConnector.TransitionConnectorFactory;
            nodeConnectorMode.OnConnectionsFinalized += NodeConnectorMode_OnConnectionsFinalized;

            InitializeContextMenus();

            PopulateNodes(nodeContextMenu);
            PopulateConnections(connectorContextMenu);

            NodeEditor.RaiseSelectionChanged();
            NodeEditor.SetPanOffset(SerializedManager.SceneNodes.PanOffset);
        }