Skip to content

Commit 3c47aea

Browse files
authored
Update TerrainInfluenceMap.cs
1 parent 7f34133 commit 3c47aea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Runtime/TerrainInfluenceMap.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ public Color[] GetDatas(Rect localRect)
160160
texture.Apply();
161161

162162
RenderTexture.active = null; // added to avoid errors
163-
return texture.GetPixels();
163+
Color[] rst = texture.GetPixels();
164+
Texture2D.Destroy(texture);
165+
166+
return rst;
164167
}
165168

166169
public Color[] GetDatas()
@@ -300,4 +303,4 @@ static bool IsDiscInsideAABB(Vector2 discCenter, float discRadius, Vector2 rectM
300303
return (ex < discRadius) && (ey < discRadius) && (ex * ex + ey * ey < discRadius * discRadius);
301304
}
302305
}
303-
}
306+
}

0 commit comments

Comments
 (0)