33 lines
848 B
C#
33 lines
848 B
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using TMPro;
|
||
|
||
public class SecretDropdown : MonoBehaviour
|
||
{
|
||
public enum SecretPlanet
|
||
{
|
||
煖莊<EFBFBD>, 竟簇債녜, 쭤張調, 犬<EFBFBD>琢, 璥猝, 蛇놋儼, 邏膣存, 到陝, 袞綎艙, 헌佾<EFBFBD>
|
||
}
|
||
|
||
[SerializeField] private TMP_Dropdown _dropdown;
|
||
[SerializeField] private SecretPlanet _planet;
|
||
[SerializeField] private TextMeshProUGUI _planetNameText;
|
||
|
||
public TMP_Dropdown Dropdown => _dropdown;
|
||
public int PlanetIndex => (int)_planet;
|
||
|
||
void Start()
|
||
{
|
||
if (_planetNameText != null)
|
||
_planetNameText.text = _planet.ToString();
|
||
_dropdown.onValueChanged.AddListener(OnValueChanged);
|
||
}
|
||
|
||
void OnValueChanged(int index)
|
||
{
|
||
if (_planetNameText != null)
|
||
_planetNameText.text = _planet.ToString();
|
||
}
|
||
}
|