summaryrefslogtreecommitdiff
path: root/TMPro/TMP_DigitValidator.cs
blob: 80e3a77a4f9f7f753afddf989b297edbfa92eed9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;

namespace TMPro;

[Serializable]
public class TMP_DigitValidator : TMP_InputValidator
{
	public override char Validate(ref string text, ref int pos, char ch)
	{
		if (ch >= '0' && ch <= '9')
		{
			pos++;
			return ch;
		}
		return '\0';
	}
}