21 lines
		
	
	
		
			740 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			21 lines
		
	
	
		
			740 B
		
	
	
	
		
			C#
		
	
	
	
|  | using System.Collections; | |||
|  | using System.Collections.Generic; | |||
|  | using UnityEngine; | |||
|  | using UnityEngine.UI; | |||
|  | 
 | |||
|  | public class ImageNum : MonoBehaviour | |||
|  | { | |||
|  |     [SerializeField] Image mImgOnes; | |||
|  |     [SerializeField] Image mImgTens; | |||
|  |     [SerializeField] Image mImgHundreds; | |||
|  | 
 | |||
|  |     public void SetNum(int pNum) | |||
|  |     { | |||
|  |         pNum = pNum % 1000; | |||
|  |         string tNumStr = pNum.ToString().PadLeft(3, '0'); | |||
|  | 
 | |||
|  |         mImgHundreds.sprite = ResourceManager.Instance.LoadRes<Sprite>(Const.Path.GetNumPicA(tNumStr[0].ToString())); | |||
|  |         mImgTens.sprite = ResourceManager.Instance.LoadRes<Sprite>(Const.Path.GetNumPicA(tNumStr[1].ToString())); | |||
|  |         mImgOnes.sprite = ResourceManager.Instance.LoadRes<Sprite>(Const.Path.GetNumPicA(tNumStr[2].ToString())); | |||
|  |     } | |||
|  | } |