GetComponent1 GetComponentInParent, GetComponentsInParent, 궁금했던 메서드 테스트 해보기 GetComponent관련 메서드를 자주 쓰고있긴 한데 항상 틀리기도 하고, 다시 찾아보게 되던걸 테스트 해보았다. 우선 빈오브젝트에 이름을 달아서 구조로 만들었다. 스크립트를 담을 오브젝트는 "Badger"에 스크립트를 달고, 각각 알고싶었던 스크립트를 작성해서 Debug.Log 해보았다. 스크립트는 간단한 구조로 버튼누르면 로그가 나오도록 했다.using System.Collections;using System.Collections.Generic;using UnityEngine;using NaughtyAttributes;public class Component_practice : MonoBehaviour{ [SerializeField] List objsList = new List();.. 2024. 6. 11. 이전 1 다음