// Checking mouse press and release events to get linear slices based on input public void LateUpdate() { for (int id = 0; id < 10; id++) { Vector2D pos = new Vector2D(input.GetInputPosition(id)); if (input.GetInputClicked(id)) { linearPair[id].A.Set(pos); } if (input.GetInputPressed(id)) { linearPair[id].B.Set(pos); } if (input.GetInputReleased(id)) { if (input.GetSlicingEnabled(id)) { LinearSlice(linearPair[id]); } } if (input.GetInputPressed(id) == false) { linearPair[id].A.Set(pos); linearPair[id].B.Set(pos); } } }
// Checking mouse press and release events to get linear slices based on input public void LateUpdate() { for (int id = 0; id < 10; id++) { Vector2 pos = input.GetInputPosition(id); if (input.GetInputClicked(id)) { linearPair[id].a = pos; } if (input.GetInputPressed(id)) { linearPair[id].b = pos; } if (input.GetInputReleased(id)) { if (input.GetSlicingEnabled(id)) { LinearSlice(linearPair[id].ToPair2D()); } } if (input.GetInputPressed(id) == false) { linearPair[id].a = pos; linearPair[id].b = pos; } } }
// Checking mouse press and release events to get linear slices based on input public void LateUpdate() { for (int id = 0; id < 10; id++) { Vector2D pos = new Vector2D(input.GetInputPosition(id)); if (input.GetInputClicked(id)) { points[id].Clear(); points[id].Add(pos); } if (input.GetInputPressed(id)) { Vector2D posMove = new Vector2D(points[id].Last()); while ((Vector2D.Distance(posMove, pos) > minVertexDistance)) { float direction = (float)Vector2D.Atan2(pos, posMove); posMove.Push(direction, minVertexDistance); points[id].Add(new Vector2D(posMove)); } } if (input.GetInputReleased(id)) { Slicer2D.complexSliceType = complexSliceType; if (input.GetSlicingEnabled(id)) { ComplexSlice(points[id]); } points[id].Clear(); } if (input.GetInputPressed(id) == false) { if (points[id].Count > 0) { points[id].Clear(); } } } }
// Checking mouse press and release events to get linear slices based on input public void LateUpdate() { Vector2D pos = new Vector2D(input.GetInputPosition(0)); if (input.GetInputPressed(0)) { linearPair.B.Set(pos); } if (input.GetInputReleased(0)) { LinearSlice(linearPair); } if (input.GetInputPressed(0) == false) { linearPair.B.Set(pos); } }
// Checking mouse press and release events to get linear slices based on input public void LateUpdate() { Vector2 pos = input.GetInputPosition(0); if (input.GetInputPressed(0)) { linearPair.b = pos; } if (input.GetInputReleased(0)) { LinearSlice(linearPair.ToPair2D()); } if (input.GetInputPressed(0) == false) { linearPair.b = pos; } }
public void LateUpdate() { Vector2 pos = input.GetInputPosition(); if (input.GetInputClicked()) { points.Clear(); points.Add(pos); } if (input.GetInputPressed()) { Vector2 posMove = points.Last(); while ((Vector2.Distance(posMove, pos) > minVertexDistance)) { float direction = pos.Atan2(posMove); posMove = posMove.Push(direction, minVertexDistance); points.Add(posMove); } } if (input.GetInputReleased()) { if (input.GetSlicingEnabled()) { ComplexMerge(points.ToVector2DList()); } points.Clear(); } if (input.GetInputPressed() == false) { if (points.Count() > 0) { points.Clear(); } } }