-
자식GameObject의 Component접근
방법1
class Player1 : MonoBehavior
memeber함수에서
this.GetComponentInChildren<TextMesh>().text = "ccddddddd";방법2
transform.GetChild(idx).GetComponent<TextMesh>.text = "kkk";
방법3transform.FindChild("ChildName").GetComponent<TextMesh>.text = "kkk";
'Unity' 카테고리의 다른 글
Unity - Meshes, Materials, Shaders, Textures (0) 2021.03.27 Unity - 실시간 네트워크 서버 엔진 Nclib(Necial)사용 (0) 2021.03.27 Unity - ProBuilder(UV Edit) (0) 2021.03.27 Unity - Rotation(Euler angle, Quaternion) (0) 2021.03.25 Unity - Unity Editor 다중 실행(창 여러개 시행) (0) 2021.03.25 Unity - UI Button (0) 2021.03.25 Unity - Prefabs (1) 2021.03.25 Unity - MonoBehaviour 생성 (0) 2021.03.25