Changeset 269 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Apr 28, 2016, 1:58:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/FileCache/MapTileCache.cs
r199 r269 17 17 private CurrentZoomFile[] cache; 18 18 19 public MapTileCache () 19 private byte[] transparentTile; 20 21 public MapTileCache (int _tileSize) 20 22 { 23 UnityEngine.Texture2D tex = new UnityEngine.Texture2D (_tileSize, _tileSize); 24 UnityEngine.Color nullColor = new UnityEngine.Color (0, 0, 0, 0); 25 for (int x = 0; x < _tileSize; x++) { 26 for (int y = 0; y < _tileSize; y++) { 27 tex.SetPixel (x, y, nullColor); 28 } 29 } 30 transparentTile = tex.EncodeToPNG (); 31 UnityEngine.Object.Destroy (tex); 21 32 } 22 33 … … 72 83 73 84 if (!File.Exists (filename)) { 74 return null;85 return transparentTile; 75 86 } 76 87 return File.ReadAllBytes (filename);
Note:
See TracChangeset
for help on using the changeset viewer.