You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.2 KiB
64 lines
2.2 KiB
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
/// <summary> |
|
/// 导调组对房间人员到达时间的设置 |
|
/// </summary> |
|
public class ArriveTimeItem : MonoBehaviour { |
|
|
|
private InputFieldRecordByAC mInputField; |
|
private InputFieldRecordByAC sInputField; |
|
private ToggleRecordByAC toggle; |
|
private Text OriText; |
|
private GameObject Image; |
|
private Color OriColor; |
|
public long UserID; |
|
public int MTime=0; |
|
public int STime = 0; |
|
// Use this for initialization |
|
void Start () { |
|
toggle = transform.Find("Toggle").GetComponent<ToggleRecordByAC>(); |
|
OriText = toggle.transform.Find("OriText").GetComponent<Text>(); |
|
Image = toggle.transform.Find("Image").gameObject; |
|
OriColor = OriText.color; |
|
|
|
mInputField = transform.Find("Panel/MInputField").GetComponent<InputFieldRecordByAC>(); |
|
sInputField = transform.Find("Panel").Find("SInputField").GetComponent<InputFieldRecordByAC>(); |
|
toggle.OutInterFaceToggle = toggleChange; |
|
mInputField.OutInterFaceInPutField = mInputFieldChange; |
|
sInputField.OutInterFaceInPutField = sInputFieldChange; |
|
} |
|
|
|
private void toggleChange(bool value) |
|
{ |
|
Image.SetActive(value); |
|
mInputField.GetComponent<InputField>() .interactable = value; |
|
sInputField.GetComponent<InputField>().interactable = value; |
|
OriText.color = value ? Color.white : OriColor; |
|
} |
|
|
|
private void sInputFieldChange(string value) |
|
{ |
|
sInputField.GetComponent<InputField>().text = value; |
|
if (string.IsNullOrEmpty(value)||value=="") |
|
{ |
|
value = "0"; |
|
} |
|
sInputField.GetComponent<InputField>().text =(Mathf.Clamp(int.Parse(value),0,59)).ToString(); |
|
STime = int.Parse(sInputField.GetComponent<InputField>().text); |
|
} |
|
|
|
void mInputFieldChange(string value) |
|
{ |
|
mInputField.GetComponent<InputField>().text = value; |
|
if (string.IsNullOrEmpty(value)||value=="") |
|
{ |
|
value = "0"; |
|
} |
|
mInputField.GetComponent<InputField>().text = (Mathf.Clamp(int.Parse(value), 0, 999)).ToString(); |
|
MTime = int.Parse(mInputField.GetComponent<InputField>().text); |
|
} |
|
}
|
|
|