33 lines
748 B
C#
33 lines
748 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.EventSystems;
|
|
|
|
namespace RimWorldAnimationStudio
|
|
{
|
|
public class DropdownMenu : MonoBehaviour, IDeselectHandler
|
|
{
|
|
public Transform dropdownMenu;
|
|
|
|
public void OpenMenu()
|
|
{
|
|
dropdownMenu.gameObject.SetActive(true);
|
|
EventSystem.current.SetSelectedGameObject(this.gameObject);
|
|
}
|
|
|
|
public void CloseMenu()
|
|
{
|
|
dropdownMenu.gameObject.SetActive(false);
|
|
}
|
|
|
|
public void OnDeselect(BaseEventData eventData)
|
|
{
|
|
Invoke("CloseMenu", 0.15f);
|
|
}
|
|
}
|
|
}
|