add project files

This commit is contained in:
Boris Nikolaev
2026-08-14 01:58:31 +03:00
parent 9134cad79b
commit 5f1e94b653
4399 changed files with 12286903 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using UnityEngine.Serialization;
[Serializable]
public class TextWrapper : MonoBehaviour
{
[SerializeField]
[FormerlySerializedAs("autoFind")]
private bool _autoFind = true;
[SerializeField]
public Text[] uiTexts;
public TextMeshProUGUI[] tmTexts;
private bool _autoFindDone;
private string _text;
public string text
{
get
{
return _text;
}
set
{
_text = value;
AutoFind();
if (tmTexts != null)
{
for (int i = 0; i < tmTexts.Length; i++)
{
tmTexts[i].text = _text;
}
}
if (uiTexts != null)
{
for (int i = 0; i < uiTexts.Length; i++)
{
uiTexts[i].text = _text;
}
}
}
}
public void Awake()
{
AutoFind();
}
private void AutoFind()
{
if (!_autoFind || _autoFindDone)
{
return;
}
uiTexts = GetComponentsInChildren<Text>();
tmTexts = GetComponentsInChildren<TextMeshProUGUI>();
_autoFindDone = true;
}
}