라이브러리 정리
This commit is contained in:
41
Assets/Sample/ColorPickerDatePickerSample.cs
Normal file
41
Assets/Sample/ColorPickerDatePickerSample.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UVC.UI.Modal.ColorPicker;
|
||||
using UVC.UI.Modal.DatePicker;
|
||||
|
||||
public class ColorPickerDatePickerSample : MonoBehaviour
|
||||
{
|
||||
private Renderer r;
|
||||
void Start()
|
||||
{
|
||||
r = GetComponent<Renderer>();
|
||||
r.sharedMaterial = r.material;
|
||||
}
|
||||
public void ChooseColorButtonClick()
|
||||
{
|
||||
_ = ColorPicker.Create(r.material.color, "Choose the cube's color!", SetColor, ColorFinished, OnCloseColorPicker, true);
|
||||
}
|
||||
private void SetColor(Color currentColor)
|
||||
{
|
||||
r.material.color = currentColor;
|
||||
}
|
||||
|
||||
private void ColorFinished(Color finishedColor)
|
||||
{
|
||||
Debug.Log("You chose the color " + ColorUtility.ToHtmlStringRGBA(finishedColor));
|
||||
}
|
||||
|
||||
private void OnCloseColorPicker()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ShowCalendar()
|
||||
{
|
||||
DatePicker.Show(System.DateTime.Now, (selectedDate) =>
|
||||
{
|
||||
Debug.Log("Selected date: " + selectedDate.ToString("yyyy-MM-dd"));
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user