fix: Improve performance for map tile loading
This commit is contained in:
@@ -87,7 +87,7 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
if (_texHandler.isDone) {
|
if (_texHandler.isDone) {
|
||||||
_tex = _texHandler.texture;
|
_tex = _texHandler.texture;
|
||||||
_tex.wrapMode = TextureWrapMode.Clamp;
|
_tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
_sprite = Sprite.Create(_tex, new Rect(0, 0, _tex.width, _tex.height), Vector2.zero, _tex.height);
|
_sprite = Sprite.Create(_tex, new Rect(0, 0, _tex.width, _tex.height), Vector2.zero, _tex.height, 0, SpriteMeshType.FullRect, Vector4.zero, false);
|
||||||
_renderer.sprite = _sprite;
|
_renderer.sprite = _sprite;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -105,6 +105,7 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
if (_req != null) {
|
if (_req != null) {
|
||||||
_req.Abort();
|
_req.Abort();
|
||||||
_req.Dispose();
|
_req.Dispose();
|
||||||
|
_texHandler.Dispose();
|
||||||
}
|
}
|
||||||
if (_sprite) Destroy(_sprite);
|
if (_sprite) Destroy(_sprite);
|
||||||
if (_tex) Destroy(_tex);
|
if (_tex) Destroy(_tex);
|
||||||
|
Reference in New Issue
Block a user