节假日icon都会发生变化,但是每次手动拖就很麻烦,所以只要icon名字是一样的,只是在不同的文件夹下,就可以批量修改,一键搞定
private void SetPlatformIcon()
{
PlatformIconKind[] kinds = PlayerSettings.GetSupportedIconKindsForPlatform(BuildTargetGroup.iOS);
for (int i = 0; i < kinds.Length; i++)
{
PlatformIcon[] platformIcons = PlayerSettings.GetPlatformIcons(BuildTargetGroup.iOS, kinds[i]);
for (int j = 0; j < platformIcons.Length; j++)
{
string textName = platformIcons[j].GetTexture().name;
Texture2D newIcon = AssetDatabase.LoadAssetAtPath<Texture2D>(_folderName + textName + ".png");
platformIcons[j].SetTexture(newIcon);
}
PlayerSettings.SetPlatformIcons(BuildTargetGroup.iOS, kinds[i], platformIcons);
}
AssetDatabase.SaveAssets();
}