1. Set the orthographic size of your main camera based on the base screen height. I don't remember exactly what this code is supposed to signify... but it works!
camera.orthographicSize = SCREENHEIGHT / 2.0f;
Setting resolution with Screen.SetResolution should just scale up properly. You may also have to ensure the Z position of your camera object is right, considering that my camera code sets the position as "(x, y, -10)" while everything else is at Z = 0.
2. Have all textures use Point filter mode, and maybe some other things. You can add an class that inherits AssetPostprocessor to your project to automatically override texture settings on import.
public class TexturePostProcessor : AssetPostprocessor
{
void OnPreprocessTexture()
{
TextureImporterSettings settings = new TextureImporterSettings();
TextureImporter importer = assetImporter as TextureImporter;
importer.ReadTextureSettings(settings);
settings.spriteAlignment = (int)SpriteAlignment.TopLeft;
importer.SetTextureSettings(settings);
importer.textureType = TextureImporterType.Advanced;
importer.isReadable = true;
importer.spritePixelsPerUnit = 1;
importer.spritePivot = new Vector2(0, 1);
importer.mipmapEnabled = false;
importer.filterMode = FilterMode.Point;
importer.maxTextureSize = 4096;
importer.textureFormat = TextureImporterFormat.RGBA32;
}
}
Some of the other things may or may not be essential. The pivot is set to the top-left by spritePivot and spriteAlignment. "World units" are equated to "pixels" by way of spritePixelsPerUnit = 1. I think isReadable allows it to be "referenced" by functions like GetPixels, which I use to generate frames from strips. I believe maxTextureSize is there because if a texture exceeds the max in one dimension (which happens for me with large horizontal font strips), it'll get compressed or something else that messes it up.
I also had "importer.wrapMode = TextureWrapMode.Clamp;" in this, but commented it out?? I want to say that was another element to fixing things like weird artifacts, but I guess it must not be essential. I'm pretty sure it has to do with what happens when you draw a texture at anything other than its actual size.
3. Never let anything have a fractional coordinate. If something does, I think it'll have proper pixel size, but be misaligned? I do all my movement through functions that only move in integers, so yeah. You could also have it snap position to integers every frame, but that could get pretty bad for performance.