My concrete question is if there is already a way to override the function I mention below?
In the MeshReplacement class there is this function:
Code: Select all
static Func<float> getTreeScaleCallback = () => Random.Range(0.6f, 1.4f);
The problem is that you never get the nature object back when MeshReplacement loads it, it just gets added to the terrain with the random scaling applied so it can't be manipulated afterwards. Ideally I'd just like to pass the scaling as an optional parameter to the ImportNatureGameObject method.
There's also another function that deals with randomizing the color of the trees, I'd probably add that as an optional parameter as well. When the parameters are unset they can still fall back on the getTreeScaleCallback and getTreeColorCallback functions.
Alternatively, if it's already possible to override these two functions I'd appreciate it if someone could point me in the right direction on how to do it