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)); }
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)); }
public void Undo() { if (SketchWorld.ActiveSketchWorld.IsObjectDeleted(this.LineSketchObject)) { SketchWorld.ActiveSketchWorld.RestoreObject(this.LineSketchObject); } LineSketchObject.AddControlPoint(OldControlPoint); }
public bool Execute() { LineSketchObject.AddControlPoint(NewControlPoint); return(true); }