public void Translation(Vector2 offset) { if (utils.PositionInView(Input.mousePosition) && offset != Vector2.zero) { viewer.Translate(new Vector2D(offset.x, offset.y)); } }
public override void OnButton() { var dis = new Vector3(originalPos.x, originalPos.y, 0) - Input.mousePosition; viewer.Translate(new Vector2D(dis.x, dis.y)); originalPos = Input.mousePosition; }