Transform.Find()

Posted ly570

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Transform.Find()相关的知识,希望对你有一定的参考价值。

代码演示:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TransformFind : MonoBehaviour

private Transform m_Transform;
private GameObject one;
private GameObject two;

void Start ()

m_Transform = gameObject.GetComponent<Transform>();
one = m_Transform.Find("D2").gameObject;
two = m_Transform.Find("D2/D3").gameObject;

Debug.Log(one.name);
Debug.Log(two.name);


--------------------- 

以上是关于Transform.Find()的主要内容,如果未能解决你的问题,请参考以下文章