Answers for "get parent name unity for inspector"

C#
0

get parent name unity for inspector

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using TMPro;
[ExecuteInEditMode]
public class getParentName : MonoBehaviour
{

    void LateUpdate()
    {
        var parentName = transform.parent.name;
        TextMeshProUGUI textmeshPro = GetComponent<TextMeshProUGUI>();
        textmeshPro.SetText(parentName);
    }
}
Posted by: Guest on September-27-2021

Code answers related to "get parent name unity for inspector"

C# Answers by Framework

Browse Popular Code Answers by Language