์ง€๊ธˆ ํ•˜๋ ค๊ณ  ํ•˜๋Š”๊ฒŒ ๋™์ ์œผ๋กœ ๋จธํ…Œ๋ฆฌ์–ผ ์ƒ์„ฑํ•ด์„œ ์„ธํŒ…ํ•˜๋Š” ๋ถ€๋ถ„์ด๊ณ 

์ฝ”๋“œ๋Š” ๋Œ€๊ฐ• ๋‹ค์Œ๊ณผ ๊ฐ™์Œ

class MyObject : MonoBehavior

{

void LoadMaterial(string TextureName)

{

string texturePath = "Textures/"+TextureName+".png";

gameObject.GetCompont<Renderer>().material = new Material(Shader.Find(texturePath));

}

}


๋‚ด๊ฐ€ ์ง€๊ธˆ Shader.find๋ฅผ ์ฒ˜์Œ ์จ๋ด์„œ ์ž˜ ๋ชจ๋ฅด๋Š”๋ฐ ์ง€๊ธˆ Textures/~~.png๊ฐ€ Resources์•„๋ž˜์— ์žˆ๊ฒŒ ํ•ด๋†จ๊ฑฐ๋“ ?

์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์ž˜ ์•ˆ๋˜๋Š” ๊ฒƒ ๊ฐ™์€๋ฐ ์–ด๋–ป๊ฒŒ ์“ฐ๋Š”๊ฒŒ ๋งž๋Š”๊ฑฐ์•ผ....?