From 04ba735ea62a7c911345025ad8dc82516d147fd9 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Wed, 19 Feb 2025 21:52:08 +0800 Subject: [PATCH] fix: Improve performance for map tile loading --- Assets/Cryville.EEW.Unity/Map/MapTile.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Cryville.EEW.Unity/Map/MapTile.cs b/Assets/Cryville.EEW.Unity/Map/MapTile.cs index 2f2a9d2..6463325 100644 --- a/Assets/Cryville.EEW.Unity/Map/MapTile.cs +++ b/Assets/Cryville.EEW.Unity/Map/MapTile.cs @@ -87,7 +87,7 @@ namespace Cryville.EEW.Unity.Map { if (_texHandler.isDone) { _tex = _texHandler.texture; _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; } else { @@ -105,6 +105,7 @@ namespace Cryville.EEW.Unity.Map { if (_req != null) { _req.Abort(); _req.Dispose(); + _texHandler.Dispose(); } if (_sprite) Destroy(_sprite); if (_tex) Destroy(_tex);