using UnityEngine; using System.Collections; using UnityEngine.UI; using System; public class DataTimeUI : MonoBehaviour { // Use this for initialization public GameObject dataPanel; public Text dataTime; public bool time; public float posX; public float posY; void Start () { } // Update is called once per frame void Update () { } public void Click() { //GameObject panel = Instantiate(dataPanel) as GameObject; //panel.transform.parent = transform; dataPanel.SetActive(true); dataPanel.transform.localPosition = new Vector3(posX, posY,0); var text = dataTime.text; DateTime dt= DateTime.Now; if (text != "") { dt = Convert.ToDateTime(text); } dataPanel.GetComponent().setDateTime(dt, time, dataTime); } }