x = GUILayout.TextField(x, GUILayout.Width(80)); x = Regex.Replace(x, @"[^0-9.]", ""); 转载于:https://www.cnblogs.com/yixuan1980/p/6648476.html