Chunk height null on regeneration of terrain
Feb 7, 2015 6:44:48 GMT
Post by tango209 on Feb 7, 2015 6:44:48 GMT
Hi,
I'm getting the following exception when I add a river path along a seem. Any idea as to why the chunks height data is null?
This is in Unity 5 Beta 22.
MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Texture.get_height () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/TextureBindings.gen.cs:49)
HoneyFramework.Chunk.CopyLastPixelColums (UnityEngine.Texture2D from, UnityEngine.Texture2D to, Boolean forCompression) (at Assets/HoneyFramework/Scripts/World/Chunk.cs:312)
HoneyFramework.Chunk.WeldChunk () (at Assets/HoneyFramework/Scripts/World/Chunk.cs:272)
HoneyFramework.Chunk.CreateGameObjectWithTextures () (at Assets/HoneyFramework/Scripts/World/Chunk.cs:183)
HoneyFramework.WorldOven+<Baking>c__Iterator10.MoveNext () (at Assets/HoneyFramework/Scripts/WorldOven.cs:316)
Here's my code that starts the regeneration of the terrain:
I'm getting the following exception when I add a river path along a seem. Any idea as to why the chunks height data is null?
This is in Unity 5 Beta 22.
MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Texture.get_height () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/TextureBindings.gen.cs:49)
HoneyFramework.Chunk.CopyLastPixelColums (UnityEngine.Texture2D from, UnityEngine.Texture2D to, Boolean forCompression) (at Assets/HoneyFramework/Scripts/World/Chunk.cs:312)
HoneyFramework.Chunk.WeldChunk () (at Assets/HoneyFramework/Scripts/World/Chunk.cs:272)
HoneyFramework.Chunk.CreateGameObjectWithTextures () (at Assets/HoneyFramework/Scripts/World/Chunk.cs:183)
HoneyFramework.WorldOven+<Baking>c__Iterator10.MoveNext () (at Assets/HoneyFramework/Scripts/WorldOven.cs:316)
Here's my code that starts the regeneration of the terrain:
/// <summary>
/// Rebuilds any chunks with changes
/// </summary>
private void RebuildDirtyChunks()
{
Hex hex;
foreach (Chunk chunk in this.MapUpdates)
{
hex = chunk.hexesCovered.First().Value;
World.instance.ReadyToPolishHex(hex);
hex.RebuildChunksOwningThisHex();
}
// Clear the river highlighter
this.RiverHighlight.SetVertexCount(0);
// Clear the terrain markers
GameObject go;
while (this.TerrainMarkers.Count > 0)
{
go = this.TerrainMarkers[0];
this.TerrainMarkers.Remove(go);
DestroyObject(go);
}
// Clear the dirty chunks list
this.MapUpdates.Clear();
}