How to make a score counter without UI

Im trying to make a score counter, but by using my own number textures. Im avoiding UI because it doesn’t have the font I would like. The way I’m doing this is using a script it works by having game objects, which are 3 digits, which start off with a zero texture I made. When I score a point, the first digit changes sprite to a number one sprite. Same thing for the rest of the numbers. Here is a script I’m currently using. By the way “dgt1” is digit1

	void Update () {
		if (score == 1) { //if the score variable is 1
			dgt1.sprite = Num1; //than change the first digit's sprite to 1
		} else if (score == 2) { //if score is 2
			dgt1.sprite = Num2; //change the sprite to 2
		} else if (score == 3) { //and so on
			dgt1.sprite = Num3;
		} else if (score == 4) {
			dgt1.sprite = Num4;
		} else if (score == 5) {
			dgt1.sprite = Num5;
		} else if (score == 6) {
			dgt1.sprite = Num6;
		} else if (score == 7) {
			dgt1.sprite = Num7;
		} else if (score == 8) {
			dgt1.sprite = Num8;
		} else if (score == 9) {
			dgt1.sprite = Num9;
		}
}

Now what I need is to count on into the tens place. So I would change the second digits sprite change to one, but then I would have to repeat the previous code go for literally every number in infinity (I don’t want a max score). This may sound a bit confusing so here is the script I’m talking about,

		if (score == 10) { //if my score is 10
			dgt1.sprite = Num0; //change the digit in the ones place to 0
			dgt2.sprite = Num1; //change the digit in the tens place to 1
		} else if (score == 11) { //and it basically repeats the previous code from here on out
			dgt1.sprite = Num1;
		} else if (score == 12) { 
			dgt1.sprite = Num2;
		} else if (score == 13) {
			dgt1.sprite = Num3;
		} else if (score == 14) {
			dgt1.sprite = Num4;
		} else if (score == 15) {
			dgt1.sprite = Num5;
		} else if (score == 16) {
			dgt1.sprite = Num6;
		} else if (score == 17) {
			dgt1.sprite = Num7;
		} else if (score == 18) {
			dgt1.sprite = Num8;
		} else if (score == 19) {
			dgt1.sprite = Num9;
		} else if (score == 20) {
			dgt1.sprite = Num0;
			dgt2.sprite = Num2;
		}

As you can see I would have to repeat this for every number that every existed. I need a much more efficient script for this. Im not sure what I could do.
Any suggestions? If anyone could make me a script for this I would highly appreciate it because I’m really stuck in my game here

I would really not advice you do it like that. You can actually import fonts into Unity and use it to display your score using the UI.Text. The script would look something like this :

using UnityEngine;
public class ScoreManager : MonoBehaviour{
	/// <summary>
	/// Reference of you text score UI
	/// That you can setup in the inspector to have right align
	/// </summary>
	public UnityEngine.UI.Text display;

	/// <summary>
	/// The minimum number of digits to be displayed
	/// Used to fill everything left with zeros
	/// </summary>
	public int minNumberOfDigits = 10;

	/// <summary>
	/// Your score to update using : Int2Textures.score = 15; //for exemple
	/// </summary>
	public static int score = 0;

	//Score at last frame to process only when there is a change
	private static int previousScore = -1;

	void Start () {

	}

	void Update () {
		if (previousScore != score)
		{
			UpdateUI();
			previousScore = score;
		}
	}

	void UpdateUI(){
		display.text = score.ToString().PadLeft(minNumberOfDigits, '0');
	}
}

Or using your method you could something like that
using UnityEngine;

public class Int2Textures : MonoBehaviour {

	/// <summary>
	/// Array containing all your textures for the number 0-9, to be set in the inspector so that [0]->Num0
	/// </summary>
	public Sprite[] numbers;

	/// <summary>
	/// Array containing all your ui references
	/// You can't really have infinite score, for multiple reasons
	/// So you'll have to set a maximum number of digits to display
	/// </summary>
	public UnityEngine.UI.Image[] digits;

	/// <summary>
	/// Your score to update using : Int2Textures.score = 15; //for exemple
	/// </summary>
	public static int score = 0;

	private static int previousScore = -1;

	// Use this for initialization
	void Start () {
		if (numbers.Length != 10) throw new System.Exception("Missing some digits to display any numbers");
	}
	
	// Update is called once per frame
	void Update () {
		if(previousScore != score){
			UpdateUI();
			previousScore = score;
		}
	}

	void UpdateUI(){
		int scoreCopy = score;
		for(int i= 0; i<digits.Length;i++){
			digits*.sprite = numbers[scoreCopy % 10]; //If you've sorted your ui from right to left, in the other case use digits[digits.Length-i-1].sprite*
  •  	scoreCopy = scoreCopy / 10;*
    
  •  }*
    
  • }*
    }

I shouldn’t give you the finnished answers because it’s better for you to learn by yourself. But the important thing is the UpdateUI() Method. You can see one is more elegant and perform better then the other, one manipules textures and do maths where the other only change a string and let the engine do the rest :
//This is better :
void UpdateUI(){
display.text = score.ToString().PadLeft(minNumberOfDigits, ‘0’);
}
//Compared to :
void UpdateUI(){
int scoreCopy = score;
for(int i= 0; i<digits.Length;i++){
digits*.sprite = numbers[scoreCopy % 10];*
scoreCopy = scoreCopy / 10;
}
}