美文网首页
Input输入框

Input输入框

作者: 归隐3中 | 来源:发表于2017-03-01 11:52 被阅读0次
01 02

脚本如下:


using UnityEngine;
using System.Collections;
public class AgeValidation : MonoBehaviour {

private UIInput input;
// Use this for initialization
void Awake () {
    input = this.GetComponent<UIInput>();
}

// Update is called once per frame
void Update () {

}
public void AgeChangeValue()
{
    int ageValue = int.Parse(input.value);
    if (ageValue>100)
    {
        input.value = "100";
    }
    else if (ageValue<18)
    {
        input.value = "18";
    }
}

}


相关文章

网友评论

      本文标题:Input输入框

      本文链接:https://www.haomeiwen.com/subject/fiyqgttx.html