Created
March 4, 2018 12:22
-
-
Save hecres/d117e3f67eeef109deea982a3390c0e0 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
| private void FillScreen() | |
| { | |
| // orthographicSizeはカメラの垂直サイズの半分です。 | |
| var worldHeight = targetCamera.orthographicSize * 2f; | |
| var worldWidth = worldHeight / Screen.height * Screen.width; | |
| transform.localScale = new Vector3(worldWidth, worldHeight); | |
| var tempPosition = Camera.main.transform.position; | |
| tempPosition.z = 0f; | |
| transform.position = tempPosition; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment