diff --git a/Assets/Scripts/Const/Const.Path.cs b/Assets/Scripts/Const/Const.Path.cs index 184795db..ee381cb4 100644 --- a/Assets/Scripts/Const/Const.Path.cs +++ b/Assets/Scripts/Const/Const.Path.cs @@ -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()); } diff --git a/Assets/Scripts/UI/CustomControl/ImageNum.cs b/Assets/Scripts/UI/CustomControl/ImageNum.cs index c2329dc9..a9ba3251 100644 --- a/Assets/Scripts/UI/CustomControl/ImageNum.cs +++ b/Assets/Scripts/UI/CustomControl/ImageNum.cs @@ -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(Const.Path.GetNumPicA(tNumStr[0].ToString())); mImgTens.sprite = ResourceManager.Instance.LoadRes(Const.Path.GetNumPicA(tNumStr[1].ToString()));