2using System.Collections.Generic;
57 public List<MeshPass>
listPass =
new List<MeshPass>();
60 public Dictionary<int, TextureReplace>
dictReplace =
new Dictionary<int, TextureReplace>();
67 DateTime lastWriteTime = File.GetLastWriteTime(
path);
68 bool flag = date.DateTime.Year != 1 &&
date.
DateTime.Equals(lastWriteTime);
71 List<int> list =
new List<int>();
74 if (!File.Exists(value.
file.FullName))
77 list.Add(value.
index);
80 foreach (
int item in list)
98 date.DateTime = lastWriteTime;
139 public void Load(
bool dateMatched)
143 Texture2D texture2D = IO.LoadPNG(
path);
149 if (
tex.width != texture2D.width ||
tex.height != texture2D.height + num)
151 Debug.Log(
id +
"/" + texture2D.width +
"/" + texture2D.height +
"/" +
path);
152 tex.Reinitialize(texture2D.width, texture2D.height + num,
tex.format,
tex.mipmapCount > 1);
156 tex.SetPixels32(0, 0,
tex.width, num,
new Color32[
tex.width * num]);
158 tex.SetPixels32(0, num, texture2D.width, texture2D.height, texture2D.GetPixels32());
160 UnityEngine.Object.Destroy(texture2D);
170 if (
item.haveShadowPass)
178 EClass.scene.tileset.AtlasTexture =
tex;
185 string text =
id +
"_" + index +
".png";
186 Texture2D texture2D =
new Texture2D(
tileW * sizeX,
tileH * sizeY);
187 int srcX = index % 100 *
tileW;
188 int srcY = tex.height - index / 100 *
tileH - texture2D.height;
189 Graphics.CopyTexture(
tex, 0, 0, srcX, srcY,
tileW * sizeX,
tileH * sizeY, texture2D, 0, 0, 0, 0);
190 byte[] bytes = texture2D.EncodeToPNG();
193 File.WriteAllBytes(
path + text, bytes);
199 UnityEngine.Object.Destroy(texture2D);
205 if (textureReplace !=
null)
209 r.original = textureReplace;
232 if (textureReplace !=
null)
Dictionary< int, TextureReplace > dictReplace
void CreateReplace(int index, string path, TextureReplace.Source source, int sizeX, int sizeY)
List< MeshPass > listPass
void DeleteReplace(TextureReplace r)
void AddReplace(TextureReplace r)
void Load(bool dateMatched)
List< TextureReplace > listReplaceLocal
void RemoveDeletedReplace(int index)
bool TryAddReplace(FileInfo file, TextureReplace.Source source=TextureReplace.Source.Mod, bool add=true, bool refresh=false)
Dictionary< string, TextureData > texMap
void TryRefresh(bool force)