|
@@ -71,6 +71,8 @@ namespace GFGGame
|
|
public byte[] MyBytes;
|
|
public byte[] MyBytes;
|
|
//本期排行榜数据
|
|
//本期排行榜数据
|
|
public List<MatchingPhotoWorksData> _currentRankList = new List<MatchingPhotoWorksData>();
|
|
public List<MatchingPhotoWorksData> _currentRankList = new List<MatchingPhotoWorksData>();
|
|
|
|
+ //本期排行榜图片数据
|
|
|
|
+ public Dictionary<string, NTexture> _currentImageDic = new Dictionary<string, NTexture>();
|
|
//往期作品集
|
|
//往期作品集
|
|
public List<MatchingWorksData> _BeforeWorksList = new List<MatchingWorksData>();
|
|
public List<MatchingWorksData> _BeforeWorksList = new List<MatchingWorksData>();
|
|
//往期排行榜数据
|
|
//往期排行榜数据
|
|
@@ -639,6 +641,10 @@ namespace GFGGame
|
|
{
|
|
{
|
|
// 目录已存在
|
|
// 目录已存在
|
|
}
|
|
}
|
|
|
|
+ if(targerPath == LocalBeforePath)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//判断手机内是否存在该图片
|
|
//判断手机内是否存在该图片
|
|
string path = Path.Combine(targerPath, string.Format("/{0}.jpg", ImageName.ToString()));
|
|
string path = Path.Combine(targerPath, string.Format("/{0}.jpg", ImageName.ToString()));
|
|
bool fileExists = File.Exists(path);
|
|
bool fileExists = File.Exists(path);
|
|
@@ -684,10 +690,24 @@ namespace GFGGame
|
|
public NTexture GetTargetImage(string ImageName,string Path)
|
|
public NTexture GetTargetImage(string ImageName,string Path)
|
|
{
|
|
{
|
|
string AllPath = Path +"/"+ ImageName;
|
|
string AllPath = Path +"/"+ ImageName;
|
|
- byte[] fileData = File.ReadAllBytes(AllPath);
|
|
|
|
- Texture2D texture = new Texture2D(1, 1);
|
|
|
|
- texture.LoadImage(fileData);
|
|
|
|
- return new NTexture(texture);
|
|
|
|
|
|
+ //byte[] fileData = File.ReadAllBytes(AllPath);
|
|
|
|
+ byte[] fileData;
|
|
|
|
+ Texture2D texture = new Texture2D(512,512);
|
|
|
|
+ //texture.LoadImage(fileData);
|
|
|
|
+ //return new NTexture(texture);
|
|
|
|
+ using (FileStream fileStream = new FileStream(AllPath, FileMode.Open, FileAccess.Read))
|
|
|
|
+ {
|
|
|
|
+ fileData = new byte[fileStream.Length];
|
|
|
|
+ int bytesRead = fileStream.Read(fileData, 0, fileData.Length);
|
|
|
|
+ if (bytesRead != fileData.Length)
|
|
|
|
+ {
|
|
|
|
+ Debug.LogError("未能完全读取文件");
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ texture.LoadImage(fileData);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ return new NTexture(texture);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//删除指定图片
|
|
//删除指定图片
|
|
public void DeleteImage(string imagePath)
|
|
public void DeleteImage(string imagePath)
|