hi all !
i’ve a monobehaviour script in terrain GameObject. This script load and unload texture, it run but i’ve two problemes :
* first when set the splatprototype of terrain data :
SplatPrototype splat = new SplatPrototype();
splat.texture = m_text as Texture2D;
terrainGameObject.GetComponent<Terrain>().terrainData.splatPrototypes = new SplatPrototype[] { splat };
i obtain an console error :
Do you know why i’ve this error and how to do to fix it ?
* second : i not be abble to unload texture memory :
foreach (SplatPrototype splat in terrainGameObject.GetComponent<Terrain>().terrainData.splatPrototypes)
DestroyImmediate(splat.texture, true);
}
Resources.UnloadUnusedAssets();
after this, the texture has destroyed but, the quantity of busy RAM dont change.
how to do to unload terrain textures ??
can you help me. thx.