コード例 #1
0
    private void lineSketchObjectTest()
    {
        lineSketchObject.AddControlPoint(new Vector3(-2, 1, 0));
        lineSketchObject.AddControlPoint(Vector3.one);
        lineSketchObject.AddControlPoint(new Vector3(2, 2, 0));
        lineSketchObject.AddControlPoint(new Vector3(2, 1, 0));

        lineSketchObject.SetLineDiameter(.7f);

        //StartCoroutine(changeDiameter());

        lineSketchObject2.AddControlPoint(new Vector3(1, 0, 0));
        lineSketchObject2.AddControlPoint(new Vector3(2, 1, 1));
        lineSketchObject2.AddControlPoint(new Vector3(3, 2, 0));
        lineSketchObject2.AddControlPoint(new Vector3(3, 1, 0));

        //GameObject selectionGO = new GameObject("sketchObjectSelection", typeof(SketchObjectSelection));
        GameObject            selectionGO = Instantiate(selectionPrefab);
        GameObject            groupGO     = new GameObject("sketchObjectGroup", typeof(SketchObjectGroup));
        SketchObjectSelection selection   = selectionGO.GetComponent <SketchObjectSelection>();

        selection.AddToSelection(lineSketchObject);
        selection.AddToSelection(lineSketchObject2);
        selection.Activate();
        StartCoroutine(deactivateSelection(selection));
    }
コード例 #2
0
    private void lineSketchObjectTest()
    {
        foreach (Transform controlPoint in controlPointParent.transform)
        {
            lineSketchObject.AddControlPoint(controlPoint.position);
            lineSketchObject2.AddControlPoint(controlPoint.position);
        }

        lineSketchObject.SetLineCrossSection(CircularCrossSection.GenerateVertices(16), CircularCrossSection.GenerateVertices(16, 1f), .5f);
        //lineSketchObject.setLineDiameter(.7f);
        StartCoroutine(changeDiameter());

        //StartCoroutine(deactivateSelection(selection));
    }
コード例 #3
0
 public void Undo()
 {
     if (SketchWorld.ActiveSketchWorld.IsObjectDeleted(this.LineSketchObject))
     {
         SketchWorld.ActiveSketchWorld.RestoreObject(this.LineSketchObject);
     }
     LineSketchObject.AddControlPoint(OldControlPoint);
 }
コード例 #4
0
 public bool Execute()
 {
     LineSketchObject.AddControlPoint(NewControlPoint);
     return(true);
 }