Last active
December 25, 2017 16:55
-
-
Save KumoKairo/e1b71c8c21f3b41698a5db01fc92b215 to your computer and use it in GitHub Desktop.
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; | |
public class Gameboy : MonoBehaviour | |
{ | |
private RenderTexture _downscaledRenderTexture; | |
private void OnEnable() | |
{ | |
var camera = GetComponent<Camera>(); | |
int height = 144; | |
int width = Mathf.RoundToInt(camera.aspect * height); | |
_downscaledRenderTexture = new RenderTexture(width, height, 16); | |
_downscaledRenderTexture.filterMode = FilterMode.Point; | |
} | |
private void OnDisable() | |
{ | |
Destroy(_downscaledRenderTexture); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment