에셋 폴더에 'Resources' 폴더 생성
Resources 폴더에 에셋 집어넣기
넣은 에셋 불러오기
예시:
void Start()
{
GameObject cube = Resources.Load<GameObject>("Cube");
}
void Start()
{
GameObject cube = Resources.Load<GameObject>("Prefabs/Cube");
}
void Start()
{
GameObject cube = Resources.Load<GameObject>("Prefabs/Cube");
TextAsset text = Resources.Load<TextAsset>("Text/texttile_01");
Texture2D texture = Resources.Load<Texture2D>("Textures/texture_01");
Sprite sprite = Resources.Load<Sprite>("Sprites/sprite_01");
AudioClip audioClip = Resources.Load<AudioClip>("Audio/audioClip_01");
}