콤퓨타/Unity
스크립트가 특정 게임 오브젝트에 포함되어 있는지 확인 하는 방법
방법1. 해당 스크립트에 디버그 로그를 찍는다. Debug.Log($"SendQueueMgr 스크립트가 포함된 오브젝트: {gameObject.name}");방법2. 스크립트를 생성한다.using UnityEngine;public class CheckSendQueueMgr : MonoBehaviour{ void Start() { SendQueueMgr sendQueueMgr = FindObjectOfType(); if (sendQueueMgr != null) { Debug.Log($"SendQueueMgr가 할당된 게임 오브젝트: {sendQueueMgr.gameObject.name}"); } else ..
2024. 8. 13. 08:02