2using System.Collections.Generic;
54 public List<MeshPass>
listPass =
new List<MeshPass>();
57 public Dictionary<int, TextureReplace>
dictReplace =
new Dictionary<int, TextureReplace>();
64 DateTime lastWriteTime = File.GetLastWriteTime(
path);
65 bool flag = date.DateTime.Year != 1 &&
date.
DateTime.Equals(lastWriteTime);
68 List<int> list =
new List<int>();
71 if (!File.Exists(value.
file.FullName))
74 list.Add(value.
index);
77 foreach (
int item in list)
95 date.DateTime = lastWriteTime;
136 public void Load(
bool dateMatched)
140 Texture2D texture2D = IO.LoadPNG(
path);
145 if (
tex.width != texture2D.width ||
tex.height != texture2D.height)
147 Debug.Log(
id +
"/" + texture2D.width +
"/" + texture2D.height +
"/" +
path);
149 tex.SetPixels32(texture2D.GetPixels32());
151 UnityEngine.Object.Destroy(texture2D);
161 if (
item.haveShadowPass)
169 EClass.scene.tileset.AtlasTexture =
tex;
176 string text =
id +
"_" + index +
".png";
177 Texture2D texture2D =
new Texture2D(
tileW * sizeX,
tileH * sizeY);
178 int srcX = index % 100 *
tileW;
179 int srcY = tex.height - index / 100 *
tileH - texture2D.height;
180 Graphics.CopyTexture(
tex, 0, 0, srcX, srcY,
tileW * sizeX,
tileH * sizeY, texture2D, 0, 0, 0, 0);
181 byte[] bytes = texture2D.EncodeToPNG();
184 File.WriteAllBytes(
path + text, bytes);
190 UnityEngine.Object.Destroy(texture2D);
196 if (textureReplace !=
null)
200 r.original = textureReplace;
223 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)