修改数字格式化
This commit is contained in:
parent
a24d4e314d
commit
68a38bbef6
|
@ -13,28 +13,28 @@ public partial class Const
|
|||
|
||||
public static string GetLevelIconBig(int pLevelID)
|
||||
{
|
||||
return string.Format("Image/LevelIcon_Big/{0}", (pLevelID + 1).ToString().PadLeft(3, '0'));
|
||||
return string.Format("Image/LevelIcon_Big/{0}", (pLevelID + 1).ToString("D3"));
|
||||
}
|
||||
|
||||
public static string GetLevelIconSmall(int pLevelID)
|
||||
{
|
||||
return string.Format("Image/LevelIcon_Small/{0}", (pLevelID + 1).ToString().PadLeft(3, '0'));
|
||||
return string.Format("Image/LevelIcon_Small/{0}", (pLevelID + 1).ToString("D3"));
|
||||
}
|
||||
|
||||
public static string GetLevelLogo(int pLevelID)
|
||||
{
|
||||
return string.Format("Image/LevelLogo/{0}", (pLevelID + 1).ToString().PadLeft(3, '0'));
|
||||
return string.Format("Image/LevelLogo/{0}", (pLevelID + 1).ToString("D3"));
|
||||
}
|
||||
|
||||
public static string GetSoundPic(int pLevelID, int pSoundIndex)
|
||||
{
|
||||
string tLevelIDStr = (pLevelID + 1).ToString().PadLeft(3, '0');
|
||||
string tLevelIDStr = (pLevelID + 1).ToString("D3");
|
||||
return string.Format("Image/SoundPic/{0}/{1}", tLevelIDStr, tLevelIDStr + "_" + (pSoundIndex + 1).ToString());
|
||||
}
|
||||
|
||||
public static string GetSound(int pLevelID, int pSoundIndex)
|
||||
{
|
||||
string tLevelIDStr = (pLevelID + 1).ToString().PadLeft(3, '0');
|
||||
string tLevelIDStr = (pLevelID + 1).ToString("D3");
|
||||
return string.Format("Audio/GameSound/{0}/{1}", tLevelIDStr, tLevelIDStr + "_" + (pSoundIndex + 1).ToString());
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ public class ImageNum : MonoBehaviour
|
|||
public void SetNum(int pNum)
|
||||
{
|
||||
pNum = pNum % 1000;
|
||||
string tNumStr = pNum.ToString().PadLeft(3, '0');
|
||||
string tNumStr = pNum.ToString("D3");
|
||||
|
||||
mImgHundreds.sprite = ResourceManager.Instance.LoadRes<Sprite>(Const.Path.GetNumPicA(tNumStr[0].ToString()));
|
||||
mImgTens.sprite = ResourceManager.Instance.LoadRes<Sprite>(Const.Path.GetNumPicA(tNumStr[1].ToString()));
|
||||
|
|
Loading…
Reference in New Issue