public void Rotate(Vector2 value) { x += value.y * (invertY ? -1f : 1f); y += value.x * (invertX ? -1f : 1f); if (clampX) { x = RangeMath.ApplyMinMax(x, xRange); } if (clampY) { y = RangeMath.ApplyMinMax(y, yRange); } transform.eulerAngles = new Vector3(x, y, 0); }
public void Rotate(float input) { value += input * (invert ? -1f : 1f); if (clamp) { value = RangeMath.ApplyMinMax(value, range); } switch (rotationAxis) { case Axis.X: transform.eulerAngles = new Vector3(value, transform.eulerAngles.y, transform.eulerAngles.z); break; case Axis.Y: transform.eulerAngles = new Vector3(transform.eulerAngles.x, value, transform.eulerAngles.z); break; case Axis.Z: transform.eulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, value); break; } }
public void Rotate(Vector2 value) { if (!active) { return; } x += value.y * (invertY ? -1f : 1f); y += value.x * (_invertX ? -1f : 1f); if (clampX) { x = RangeMath.ApplyMinMax(x, xRange); } if (clampY) { y = RangeMath.ApplyMinMax(y, yRange); } self.eulerAngles = new Vector3(x, y, 0); }