I want to create a ground plane that can be scaled to any size and maintain the same texture size on the surface without having to change the material tiling every time.
To give an example. Make a plane 1000x1000x1000. Add a grid 100x100 pixel texture and change the tiling to 1000 on both x and y. Now when you scale the plane the texture changes size relative to everything else.
Basically you look for changes in scale and adjust the tiling accordingly. If you want this in the editor, make the script ‘execute in editor’. Note that affecting the tiling is per-material so if that same material is used elsewhere, it will mess with them. The other option is to play with UV’s but I wouldn’t.
And change the plane’s size instead of scale. Except you don’t want to do it at run time very often, because it regenerates the mesh. It’s an out-of-the-box implementation of the second method you describe. It has an advantage of not taxing your material count.