Skip to content

Instantly share code, notes, and snippets.

@haramakoto
Created January 25, 2023 01:59
Show Gist options
  • Save haramakoto/a13e317d9b21fc15e92684be314b5001 to your computer and use it in GitHub Desktop.
Save haramakoto/a13e317d9b21fc15e92684be314b5001 to your computer and use it in GitHub Desktop.
画像で数字を表示する・1桁分
namespace com.etc.utility
{
using UnityEngine;
using UnityEngine.UI;
public class ImageNumViewUnit : MonoBehaviour
{
[SerializeField]
private Sprite[] numSprites;
[SerializeField]
private Image numImage;
public void ShowNum(int num)
{
this.numImage.sprite = this.numSprites[num];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment