|
|
你把下面这个发到我的悬赏帖下领悬赏,然后你再单独开一贴发怎么改这个,再给你30贡献度和300金元
themes添加类
private Sprite[,] themes_SCREENSHOTS;
public Sprite GetScreenshot(int theme_, int grafikPoints)
{
int num = 0;
int num2 = 0;
while (num2 < 1000 && System.IO.File.Exists(string.Concat(new string[]
{
Application.dataPath,
"/Extern/Screenshots/",
theme_.ToString(),
"/",
num2.ToString(),
".png"
})))
{
num = num2;
num2++;
}
int num3 = 30000 / (num + 1);
num3 = grafikPoints / num3;
if (num3 < 0)
{
num3 = 0;
}
if (num3 > num)
{
num3 = num;
}
if (this.themes_SCREENSHOTS[theme_, num3])
{
return this.themes_SCREENSHOTS[theme_, num3];
}
this.themes_SCREENSHOTS[theme_, num3] = this.mS_.LoadPNG(string.Concat(new string[]
{
Application.dataPath,
"/Extern/Screenshots/",
theme_.ToString(),
"/",
num3.ToString(),
".png"
}));
return this.themes_SCREENSHOTS[theme_, num3];
}
改动gamescript
public Sprite GetScreenshot()
{
return this.themes_.GetScreenshot(this.gameMainTheme, Mathf.RoundToInt(this.points_grafik));
}
改动initArrays,49是文件夹内图片最大数,根据实际改
最后加上
this.themes_SCREENSHOTS = new Sprite[this.tS_.themes_EN.Length, 49]; |
|