void Awake() { cam = Camera.main; offsetX = 0; dirs [0] = new Vector3(-offsetX, 0, 0); dirs [1] = new Vector3(Screen.width + offsetX, 0, 0); dirs [2] = new Vector3(-offsetX, Screen.height, 0); dirs [3] = new Vector3(Screen.width + offsetX, Screen.height, 0); terrain = GameObject.FindGameObjectWithTag("Terrain").GetComponent <InfinitTerrain>(); }
void Start() { terrain = GameObject.FindGameObjectWithTag("Terrain").GetComponent <InfinitTerrain>(); }