comments
This commit is contained in:
parent
d6c0048271
commit
0293a920ef
@ -77,13 +77,16 @@ public class GrassField : MonoBehaviour {
|
||||
|
||||
private void Update() {
|
||||
#if UNITY_EDITOR
|
||||
// update LOD distances (might have been changed via inspector)
|
||||
// LOD distances might have been changed via Inspector -> Update materials
|
||||
// Camera might have been moved -> Update LODs
|
||||
UpdateLODsAndMaterials();
|
||||
#else
|
||||
if (_chunks.Length != numChunks * numChunks) return;
|
||||
var cam = Camera.main;
|
||||
if (!cam) return;
|
||||
UpdateLODs(cam.transform.position, false); // while the game is running, only update the chunks near the camera
|
||||
// while the game is running, only update the chunks near the camera
|
||||
// if the camera moved a great distance since the last frame, this fails
|
||||
UpdateLODs(cam.transform.position, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user