using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
namespace Bitsplash.DatePicker
{
public abstract class DatePickerDropDownBase : MonoBehaviour
{
///
///
///
public string NoSelectionPrompt = "Select a date...";
///
/// the date format of the label
///
public string labelDateFormat = "d";
///
/// the date picker settings object for the drop down
///
public DatePickerSettings DropDownContent;
///
/// the drop down button
///
public Button DropDownButton;
GameObject mBlocker;
// Start is called before the first frame update
void Start()
{
InitDropDown();
}
///
/// initializes the drop down events
///
void InitDropDown()
{
if(DropDownButton == null)
Debug.LogWarning("Drop Down Button Not Assigned"); // show warninig
else
DropDownButton.onClick.AddListener(ButtonClicked); // listen to drop down button clicks
if (DropDownContent == null)
Debug.LogWarning("Drop Down Content Not Assigned");// show warninig
else
{
// set the selection mode to single.
DropDownContent.Content.SelectionMode = SelectionType.Single;
// listen to selection changed events on the date picker
DropDownContent.Content.OnSelectionChanged.AddListener(SelectionChanged);
// disable the drop down object
DropDownContent.gameObject.SetActive(false);
Canvas canvas = CommonMethods.EnsureComponent