This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| /** | |
| * A camera to help with Orthagonal mode when you need it to lock to pixels. Desiged to be used on android and retina devices. | |
| */ | |
| public class PixelPerfectCam : MonoBehaviour { | |
| /** | |
| * The target size of the view port. | |
| */ | |
| public Vector2 targetViewportSizeInPixels = new Vector2(480.0f, 320.0f); | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Drop this script in the Editor directory in your project (creating the Editor directory if it's not there yet) | |
| // Then re-import the assets in the directories covered by this script (right click and reimport) | |
| // | |
| // I would replace my path checking with the path checking from this gist: | |
| // https://gist.github.com/1842177 | |
| // | |
| // The texture settings for icons might want to use some of his settings combined with mine as well | |
| using UnityEngine; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
| var metas = document.getElementsByTagName('meta'); | |
| var i; | |
| if (navigator.userAgent.match(/iPhone/i)) { | |
| for (i=0; i<metas.length; i++) { | |
| if (metas[i].name == "viewport") { | |
| metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
| } | |
| } |
NewerOlder