Ejemplo n.º 1
0
    public void CheckConnection(Mapper_Editor editor)
    {
        if (conType == ConType.cParent)
        {
            DrawConnection(editor);
        }

        if (Clicked())
        {
            Mapper_NodeConnector.nodeWaitingForConnection = this;
            Event.current.Use();
        }

        if (!ConnectionInProgress())
        {
            if (Released())
            {
                TryMakeConnection();
            }
            return;
        }

        if (Event.current.type == EventType.Repaint && Mapper_NodeConnector.nodeWaitingForConnection != null)
        {
            Color c = Color.black;

            bool    input = (conType == ConType.cChild);
            Vector2 start = input ? GetConnectionPoint() : MousePos();
            Vector2 end   = input ? MousePos() : GetConnectionPoint();;

            DrawTempLine(start, end);
        }
    }
 public Mapper_EditorNodeView Initialize(Mapper_Editor editor)
 {
     this.editor = editor;
     selection   = ScriptableObject.CreateInstance <Mapper_SelectionInfo>().Initialize(editor);
     rect        = new Rect();
     cameraPos   = new Vector2(32500, 32500);
     return(this);
 }
    public Mapper_SelectionInfo Initialize(Mapper_Editor editor)
    {
        this.editor    = editor;
        mainNode       = null;
        objectNode     = null;
        connectionLine = null;

        return(this);
    }
Ejemplo n.º 4
0
    void DrawConnection(Mapper_Editor editor)
    {
        // foreach (Mapper_NodeConnectionLine line in childLines)
        // {
        //     line.Draw();
        // }

        for (int i = 0; i < childLines.Count; i++)
        {
            childLines[i].Draw();
        }
    }
Ejemplo n.º 5
0
    public virtual Mapper_Node Initialize(Mapper_Editor editor, Vector2 pos, string nodeName)
    {
        seInfo = new SceneAndEditorInfo();

        connectors = new List <Mapper_NodeConnector>();
        connectors.Add(ScriptableObject.CreateInstance <Mapper_NodeConnector>().Initialize(this, ConType.cChild));
        connectors.Add(ScriptableObject.CreateInstance <Mapper_NodeConnector>().Initialize(this, ConType.cParent));

        this.nodeName = nodeName;
        this.editor   = editor;
        InitializeDefaultRect(pos);
        return(this);
    }
Ejemplo n.º 6
0
    public static bool Init(bool load = false)
    {
        Mapper_Editor objectEditor = (Mapper_Editor)EditorWindow.GetWindow(typeof(Mapper_Editor));

        Mapper_Editor.instance = objectEditor;
        bool loaded = objectEditor.InitializeInstance(load);

        if (!loaded)
        {
            return(false);
        }
        return(true);
    }
    public Mapper_NodeConnectionLine Initialize(Mapper_NodeConnector parentNode, Mapper_NodeConnector childNode, Mapper_Editor editor, ConnectionInfo connectionInfo = null)
    {
        this.editor     = editor;
        this.parentNode = parentNode;
        this.childNode  = childNode;

        if (connectionInfo == null)
        {
            this.connectionInfo = new ConnectionInfo();
        }
        else
        {
            this.connectionInfo = connectionInfo;
        }

        return(this);
    }
Ejemplo n.º 8
0
    public Mapper_Node Initialize(Mapper_Editor editor, Vector2 pos, string nodeName, ObjectInfo objectInfo = null)
    {
        seInfo = new SceneAndEditorInfo();

        connectors = new List <Mapper_NodeConnector>();
        connectors.Add(ScriptableObject.CreateInstance <Mapper_NodeConnector>().Initialize(this, ConType.cChild));
        connectors.Add(ScriptableObject.CreateInstance <Mapper_NodeConnector>().Initialize(this, ConType.cParent));

        this.nodeName = nodeName;
        this.editor   = editor;
        InitializeDefaultRect(pos);

        if (objectInfo == null)
        {
            this.objectInfo = new ObjectInfo(nodeName);
        }
        else
        {
            this.objectInfo = objectInfo;
        }

        return(this);
    }
Ejemplo n.º 9
0
 public Mapper_SheetToEditor Initialize(Mapper_Editor editor)
 {
     this.editor = editor;
     return(this);
 }
Ejemplo n.º 10
0
 public Mapper_EditorToScene Initialize(Mapper_Editor editor)
 {
     this.editor = editor;
     return(this);
 }
Ejemplo n.º 11
0
 public Mapper_EditorNodeBrowser Initialize(Mapper_Editor editor)
 {
     this.editor = editor;
     nodesData   = editor.browserNodes;
     return(this);
 }
Ejemplo n.º 12
0
 public Mapper_InfoWindow Initialize(Mapper_Editor editor)
 {
     this.editor = editor;
     selection   = editor.nodeView.selection;
     return(this);
 }