public class GameManager : MonoBehaviour
{
[SerializeField] Transform pos;
void Start()
{
//[플레이어 생성]
//Resourecs 폴더에서 직접 가지고 오기
GameObject player = Resources.Load<GameObject>("Player");
//프리팹으로 객체 생성
GameObject go = Instantiate(player, pos.position, Quaternion.identity);
//[카메라]
//시네머신 카메라 플레이어 따라가기
GameObject.Find("CM").GetComponent<CinemachineVirtualCamera>().Follow = go.transform;
}
https://learnandcreate.tistory.com/753
유니티에서 Resources.Load 함수를 사용하여 에셋 로드하기
유니티에서 Resources.Load 함수를 사용하여 에셋 로드하기 Resource 폴더는 유니티가 특별한 목적으로 예약한 폴더 중 하나로 해당 폴더에 에셋을 위치시키면 load함수를 사용하여 불러오기할수있다.
learnandcreate.tistory.com
728x90
'유니티' 카테고리의 다른 글
[유니티] 2D 플레이어 애니메이션 (0) | 2023.08.08 |
---|---|
[유니티] 디버깅 방법 (0) | 2023.08.08 |
[유니티] 페이드 인 아웃 (0) | 2023.07.31 |
[유니티] 마우스 터치패드 조작 (0) | 2023.07.28 |
[유니티] 사운드 재생하기 (0) | 2023.07.28 |