OneShotOneKill/Assets/Script/UGUI/Util/SetLocalText.cs

37 lines
827 B
C#
Raw Permalink Normal View History

2026-01-07 21:27:42 +00:00
using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class SetLocalText : MonoBehaviour
{
static List<Action> actionList = new List<Action>();
public static void Add_Action(Action _Act) { actionList.Add(_Act); }
public static void Run_Action()
{
for (int i = 0; i < actionList.Count; i++)
{
if (actionList[i] != null)
actionList[i].Invoke();
}
}
public int m_localtextKey;
TextMeshProUGUI m_Text;
private void Awake()
{
m_Text = GetComponent<TextMeshProUGUI>();
Set();
Add_Action(Set);
}
void Set()
{
if (table_localtext.Ins)
m_Text.text = table_localtext.Ins.Get_Text(m_localtextKey);
else
m_Text.text = "no table";
}
}