public override void onMouseDown(int x, int y)
 {
     start = drawingToolBox.GetCanvas().GetDrawingObjectAt(x, y, true);
     Debug.WriteLine("drop " + x + " " + y);
     if (start != null)
     {
         lineObject = new ConnectorLine(x, y, x, y, this.getPenClone());
         drawingToolBox.GetCanvas().AddDrawingObject(lineObject);
     }
 }
Beispiel #2
0
    public void CreateNewLine()
    {
        ConnectorLine newLine = new ConnectorLine();

        GameObject clone = (GameObject)Instantiate(line, Vector3.zero, Quaternion.identity);         //NGUITools.AddChild(connectorLineContainer.gameObject, line);

        clone.transform.parent = connectorLineContainer;

        newLine.thisLine = clone;

        connectorLines.Add(newLine);
    }
 public override void onMouseUp(int x, int y)
 {
     if (start != null)
     {
         DrawingObject end = drawingToolBox.GetCanvas().GetDrawingObjectAt(x, y, true);
         if (end != null)
         {
             lineObject.setConnectable((IConnectable)start, (IConnectable)end);
             lineObject.SetState(StaticState.GetInstance());
         }
         else if (lineObject != null)
         {
             this.drawingToolBox.GetCanvas().RemoveDrawingObject(lineObject);
         }
     }
     lineObject = null;
 }