Created
September 30, 2013 08:40
-
-
Save RANUX/6760957 to your computer and use it in GitHub Desktop.
TIP: C# Unity3d screen coordinates to world point
This file contains 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 UIRandomSpriteSeeder : MonoBehaviour | |
{ | |
private Vector3 TopRightPoint; | |
private Vector3 BottomLeftPoint; | |
void Start() | |
{ | |
BottomLeftPoint = Camera.main.ScreenToWorldPoint( Vector3.zero ); | |
TopRightPoint = Camera.main.ScreenToWorldPoint( new Vector3( Screen.width, Screen.height )); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment