Recent posts

ContainsKey & TryGetValue

June 30 2021

TryGetValue vs. ContainsKey? ```csharp // key๊ฐ€ ์žˆ๋Š”์ง€ ์ฒดํฌ public bool ContainsKey(TKey key) { return (this.FindEntry(key) >= 0); }

default ํ‚ค์›Œ๋“œ

June 14 2021

default ์—ฐ์‚ฐ์ž default ํ‚ค์›Œ๋“œ๋Š” ํ•ด๋‹น ๋ณ€์ˆ˜ ํƒ€์ž…์˜ ๊ธฐ๋ณธ ๋˜๋Š” ๋นˆ ์ƒํƒœ๋ฅผ ๋ฐ˜ํ™˜ ์ฐธ์กฐ ํ˜•์‹(class, delegate, โ€ฆ)์˜ default ๊ฐ’: null ๊ฐ’ ํ˜•์‹ (struct, enum, โ€ฆ)์˜ default ๊ฐ’: all-zeroes value int 0, DateTime 0001-01-01 00:00:0...

Blittable & Unblittable

June 14 2021

Managed vs. Unmanaged Code Unmanaged code๋ž€ ์ปดํ“จํ„ฐ ๊ตฌ์กฐ, ํ”„๋กœ์„ธ์„œ์— ํŠนํ™”๋˜์–ด ๊ทธ์— ์˜์กดํ•˜๋Š” ์ฝ”๋“œ C#์—์„œ๋Š” unsafe ํ‚ค์›Œ๋“œ๋ฅผ ์ด์šฉํ•˜๋Š” ์ฝ”๋“œ ํ”„๋กœ๊ทธ๋ž˜๋จธ์— ์˜ํ•ด ์ง์ ‘ ๊ด€๋ฆฌ Managed code๋ž€ .NET ํ”„๋ ˆ์ž„์›Œํฌ์—์„œ ๊ตฌ๋™ํ•˜๋Š” C# ์ฝ”๋“œ ์ž์ฒด ...

lock ํ‚ค์›Œ๋“œ

June 04 2021

lock ํ‚ค์›Œ๋“œ ๊ฐœ์ฒด์— ๋Œ€ํ•œ ๋ฎคํ…์Šค๋ฅผ ํš๋“ํ•˜๊ณ  signal๊ณผ unlock์„ ์‹คํ–‰

DontDestroyOnLoad

June 03 2021

DontDestroyOnLoad ์ƒˆ๋กœ์šด Scene์ด ๋กœ๋“œ๋  ๋•Œ, ์ž๋™์œผ๋กœ ํŒŒ๊ดด๋˜์ง€ ์•Š๋Š” target ์˜ค๋ธŒ์ ํŠธ๋ฅผ ์ƒ์„ฑ ์ƒˆ ๋ ˆ๋ฒจ์ด ๋กœ๋“œ๋˜๋ฉด Scene์˜ ๋ชจ๋“  ์˜ค๋ธŒ์ ํŠธ๋“ค์€ ํŒŒ๊ดด๋˜๊ณ , ์ƒˆ ๋ ˆ๋ฒจ์˜ ์˜ค๋ธŒ์ ํŠธ๋“ค์ด ๋กœ๋“œ๋œ๋‹ค. ๋ ˆ๋ฒจ ์Šค์œ„์น˜ ์ค‘์— ์˜ค๋ธŒ์ ํŠธ๋ฅผ ๋ณด์กดํ•˜๊ธฐ ์œ„ํ•ด DontDestroyOnLoad ์‚ฌ์šฉ ํ•ด๋‹น ์˜ค๋ธŒ์ ํŠธ๊ฐ€ component์ด๊ฑฐ๋‚˜ gam...