下拉条.png
image.png
image.png
image.png
1、
/***********************
* Title: 年 月 日
* FileName:
* Date: 2020
* Author: 玄策
* Version: 1.0
* UnityVersion: 2019.2.4f1
* Description:
* Func:
* -
***********************/
using System.Collections;
using System;
using UnityEngine;
using UnityEngine.UI;
public class ChoiceTime : MonoBehaviour
{
[Tooltip("箭头图片")]
//public Sprite[] Arrows;
//显示时间的文字
public Text Text_Data;
//显示箭头的图片
private Image ArrowsImage;
//选择时间界面
public GameObject ChoiceTimeObj;
//按钮
private Button ChoiceBtn;
//是否选择时间
private bool isShowChoiceTime;
void Start()
{
//Text_Data = GameObject.Find("Text_Data").GetComponent();
//ArrowsImage = GameObject.Find("ShowArrows").GetComponent();
//ChoiceTimeObj = GameObject.Find("Time_Data");
ChoiceTimeObj.SetActive(false);
ChoiceBtn = GetComponent();
ChoiceBtn.onClick.AddListener(StartChoiceTime);
}
private void OnEnable()
{
//开始默认选择系统时间
//Text_Data.text = DateTime.Now.ToString("yyyy年MM月dd日 HH : mm : ss");
Text_Data.text = DateTime.Now.ToString("yyyy 年 MM 月 dd 日");
}
// Update is called once per frame
void Update()
{
if (ChoiceTimeObj.activeSelf)
{
isShowChoiceTime = true;
}
else
{
isShowChoiceTime = false;
}
}
public void StartChoiceTime()
{
//作战时间的number为1,开始时间的number为2
if (!isShowChoiceTime)
{
//显示选择时间界面
ChoiceTimeObj.SetActive(true);
//箭头向下
//ArrowsImage.sprite = Arrows[1];
}
else
{
//关闭选择时间界面
ChoiceTimeObj.