mirror of
https://github.com/ConjureETS/GameOff2024.git
synced 2026-03-24 05:00:59 +00:00
31 lines
718 B
C#
31 lines
718 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace GameOff.UI
|
|
{
|
|
public class NavElementUI : MonoBehaviour
|
|
{
|
|
[SerializeField] private Transform section;
|
|
[SerializeField] private Text title;
|
|
[SerializeField] private Button button;
|
|
|
|
private void Start()
|
|
{
|
|
title.text = section.name;
|
|
button.onClick.AddListener(() => section.SetAsLastSibling());
|
|
}
|
|
|
|
private void OnValidate()
|
|
{
|
|
if(section)
|
|
{
|
|
title.text = section.name;
|
|
transform.name = $"{section.name} - NavElementUI";
|
|
}
|
|
else
|
|
title.text = "None";
|
|
}
|
|
}
|
|
}
|