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(); thisText = GetComponent(); } [ContextMenu("UpdateValidate")] public void OnValidate() { if (childText == null) childText = GetComponentInChildren(); if (thisText == null) thisText = GetComponent(); if (childText == null) return; if (thisText == null) return; childText.OnValidate(); } }