๐ŸŽฎ Unity Study/C#

C# & Unity Code Convention

ibelieveinme 2023. 8. 29. 00:22
728x90

 

Unity ์—์„œ Microsoft์™€ Google์˜ C# Code Convention์„ ๊ธฐ๋ฐ˜์œผ๋กœ Unity ๊ถŒ์žฅ Coding ๊ทœ์น™์„ ์ •๋ฆฌํ•ด์ค€ ๋ฌธ์„œ๋ฅผ ์ œ๊ณตํ•œ๋‹ค.

 

Create a C# style guide: Write cleaner code that scales

Get tips from industry experts on how to create a C# code style guide. A style guide can help your team develop a codebase to support the growth of your project to a commercial-scale production.

resources.unity.com

 

์•„๋ž˜ ๋งํฌ์—์„œ ๋ฒˆ์—ญ์ค‘ ~

 

C# Coding Convention

C# Coding Convention 1. ๋ช…๋ช… ๊ทœ์น™ 1) ๋ณ€์ˆ˜ ๋ณ€์ˆ˜ ์ด๋ฆ„์€ ๋ช…์‚ฌ๋กœ. bool ๋ณ€์ˆ˜๋Š” ์ ‘๋‘์‚ฌ + ๋™์‚ฌ ์กฐํ•ฉ์œผ๋กœ. ex) isDead, isWalking, hasDamageMultiplier public ๋ณ€์ˆ˜๋Š” Pascal ํ‘œ๊ธฐ๋ฒ• ์‚ฌ์šฉ private ๋ณ€์ˆ˜๋Š” Camel ํ‘œ๊ธฐ๋ฒ•๊ณผ ๋ฐ‘์ค„(_)

docs.google.com

 

private ๋ณ€์ˆ˜ _ ๋ถ™์ด๋Š”๊ฑฐ, public ๋ณ€์ˆ˜ ํŒŒ์Šค์นผ ๊ทœ์น™ ๋”ฐ๋ฅด๋Š”๊ฑฐ, { ์•„๋ž˜์— ๋‹ค๋Š”๊ฑฐ ๋“ฑ๋“ฑ ๊ณ ์น ๊ฒŒ ๋งŽ๋‹ค..!

728x90