Grass Sprites now randomized

This commit is contained in:
j-weissen 2022-06-23 14:56:39 +02:00
parent f5e4c8b789
commit 9151d987a7
4 changed files with 20 additions and 9 deletions

View file

@ -12,8 +12,8 @@ public class TileController : MonoBehaviour {
// Start is called before the first frame update
void Start() {
Camera camera = cameraGameObject.GetComponent<Camera>();
Tiles = new List<List<GameObject>>();
Camera camera = cameraGameObject.GetComponent<Camera>();
Vector3 screen = camera.ViewportToWorldPoint(new Vector3(1, 1, camera.nearClipPlane));
int x = Convert.ToInt32(Math.Ceiling(screen.x));
int y = Convert.ToInt32(Math.Ceiling(screen.y));