- Redone most UIs (WIP) - New world map - Game LOGO - main menus updated (WIP)
35 lines
787 B
C#
35 lines
787 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
[RequireComponent(typeof(TMP_Text))]
|
|
public class TMP_ValidadeFromParentToChild : MonoBehaviour
|
|
{
|
|
TMP_CopyTextFromParent childText;
|
|
TMP_Text thisText;
|
|
|
|
private void Awake()
|
|
{
|
|
childText = GetComponentInChildren<TMP_CopyTextFromParent>();
|
|
|
|
thisText = GetComponent<TMP_Text>();
|
|
}
|
|
|
|
[ContextMenu("UpdateValidate")]
|
|
public void OnValidate()
|
|
{
|
|
if (childText == null)
|
|
childText = GetComponentInChildren<TMP_CopyTextFromParent>();
|
|
|
|
if (thisText == null)
|
|
thisText = GetComponent<TMP_Text>();
|
|
|
|
if (childText == null) return;
|
|
if (thisText == null) return;
|
|
|
|
|
|
childText.OnValidate();
|
|
}
|
|
}
|