Effecting Terrain Settings (Detail Distance/Density Ect)Due To Quality Settings

I Have My Game, Where I Want To effect The Terrain Settings, Due To My Quality Settings, For Example, If Im At The Low Quality Setting, I Want My Detail Density To Be Lower Then The Medium Quality Setting, Im Coding This In JavaScript, But feel free to help out in CSharp.
Daniel Cottingham, Founder Of Endorphic Studios

:sunglasses::hushed::twisted::lol::sad::|:roll_eyes::face_with_spiral_eyes:;):p:rage::):(:smile::slight_smile:

If you have API access to those parameters of terrain data, you can set it at the same time you change the quality settings. If you only change quality settings on startup, the approach is almost identical. Either way you’re building a switch:

int qualityLevel = QualitySettings.GetQualityLevel();

switch (qualityLevel) {
case 0:
myTerrain.terrainData.detailResolution = whatever;
// other terrainData settings here
break;
//...
default:break;
}