You've already forked Darklings-FightingGame
mirror of
https://github.com/izzy2lost/Darklings-FightingGame.git
synced 2026-03-10 11:35:19 -07:00
30 lines
642 B
C#
30 lines
642 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
public class TrainingSubOption : MonoBehaviour
|
|
{
|
|
[SerializeField] private Selectable _initialSelectable = default;
|
|
private Selectable _currentInitialSelectable;
|
|
|
|
|
|
public void Activate()
|
|
{
|
|
gameObject.SetActive(true);
|
|
if (_currentInitialSelectable == null)
|
|
{
|
|
_currentInitialSelectable = _initialSelectable;
|
|
}
|
|
_currentInitialSelectable.Select();
|
|
}
|
|
|
|
public void Disable()
|
|
{
|
|
if (gameObject.activeSelf)
|
|
{
|
|
_currentInitialSelectable = EventSystem.current.currentSelectedGameObject.GetComponent<Selectable>();
|
|
}
|
|
gameObject.SetActive(false);
|
|
}
|
|
}
|