Example #1
0
    // We do this in late update to that we let everything that's going to move the object, move it.
    private void LateUpdate()
    {
        var position     = transform.position;
        var pixelPerfect = (Vector3)PixelMovementUtility.PixelPerfectClamp(position, pixelsPerUnit);

        pixelPerfect.z = position.z;

        transform.position = pixelPerfect;
    }
Example #2
0
 private Vector2 GetPixelPerfectVector(Vector2 vector)
 {
     return(PixelMovementUtility.PixelPerfectClamp(vector, spriteRenderer.sprite.pixelsPerUnit));
 }