How do I get a 1:1 pixel ratio?

I’m interested in making a tile-based game in Unity. One of my main concerns with this tile game is that the game should have a 1:1 pixel ratio with the tiles, so that the tiles will always display at exactly the same size on the screen, no matter the resolution of the standalone. How do I do this? I tried this script:

@script ExecuteInEditMode()

var spriteSize = 64.0;

// set the camera to the correct orthographic size (so scene pixels are 1:1)
s_baseOrthographicSize = Screen.height / spriteSize / 2.0;
Camera.main.orthographicSize = s_baseOrthographicSize;

But it doesn’t do the trick–as I change the size of the editor window, the size of my tiles onscreen changes. So, how do I get a constant 1:1 pixel ratio in my game, such that a pixel in one of my assets from Photoshop is equivalent to a pixel on the screen of my game, and will be so regardless of the game’s resolution?

Change the filter mode on your texture to point.

But having one of those sprite handlers is really nice. I have been having great luck with 2D toolkit. It is easy to use and the creator of the thing will basically personally answer all your questions on their forum.

You need “Pixel Perfect”. There are several Unity plugins that can easily provide Pixel Perfect to your project.
For example, here are some that I can remember:

  • Sprite Manager (is free and you can get it in UnifyCommunity)
  • Sprite Manager 2 (is a paid and more robust version of the free one)
  • Ex2D

Also, there’s a thread that may help you to set manually this 1:1 pixel ratio:
Displaying exact pixels with SpriteManager.