๐ŸŽฎ Unity Study/Unity

[Unity][Unity Script serialization] SerializeField, Serializable, HideInInspector

ibelieveinme 2022. 10. 12. 15:01
728x90

* ์ง๋ ฌํ™”(Serialization)?

๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋‚˜ ์˜ค๋ธŒ์ ํŠธ ์ƒํƒœ๋ฅผ Unity ์—๋””ํ„ฐ๊ฐ€ ์ €์žฅํ•˜๊ณ  ๋‚˜์ค‘์— ์žฌ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ํฌ๋งท์œผ๋กœ ์ž๋™์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ํ”„๋กœ์„ธ์Šค

 

  • SerializeField: private ๊ฐ์ฒด๋ฅผ Inspector์— ๋…ธ์ถœ์‹œํ‚ค๊ณ  ์‹ถ์„ ๋•Œ
  • Serializable: private ํด๋ž˜์Šค, ๊ตฌ์กฐ์ฒด๋ฅผ Inspector์— ๋…ธ์ถœ์‹œํ‚ค๊ณ  ์‹ถ์„ ๋•Œ
  • HideInInspector: public ๊ฐ์ฒด๋ฅผ Inspector์— ๋…ธ์ถœ์‹œํ‚ค๊ณ  ์‹ถ์ง€ ์•Š์„ ๋•Œ

 

[Script Serialization์— ๋Œ€ํ•œ Unity ๊ณต์‹ ๋ฌธ์„œ ์ฐธ๊ณ ]

 

์Šคํฌ๋ฆฝํŠธ ์ง๋ ฌํ™” - Unity ๋งค๋‰ด์–ผ

์ง๋ ฌํ™”๋Š” ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋‚˜ ์˜ค๋ธŒ์ ํŠธ ์ƒํƒœ๋ฅผ Unity ์—๋””ํ„ฐ๊ฐ€ ์ €์žฅํ•˜๊ณ  ๋‚˜์ค‘์— ์žฌ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ํฌ๋งท์œผ๋กœ ์ž๋™์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ํ”„๋กœ์„ธ์Šค๋ฅผ ๋งํ•ฉ๋‹ˆ๋‹ค. Unity ์—๋””ํ„ฐ์—์„œ๋Š” ์ €์žฅ ๋ฐ ๋กœ๋”ฉ, ์ธ์ŠคํŽ™ํ„ฐ ์ฐฝ, ์ธ

docs.unity3d.com

 

728x90