[내일 배움 캠프 Unity 4기] W5D2 05.14 TIL

김용준·2024년 5월 14일
0

내일배움캠프

목록 보기
14/47

Goals

  • Make UML diagram with the project of lecture
  • C# study - preprocessor

UML diagram (draft)

From the previous projects, I've been felt the needs for the planning. There are some tools to draw the blueprint;ERD,UML, ... The UML,Unified Modeling Language, is the diagram which shows project flow by visualization. The lecture of Unity, However, didn't show full diagram of class connection and hierachy. To learn the planning, I tried to draw UML diagram with the lecture project.

Firstly, the lecture teached with the lots of scripts. To classify the script with its role, I divide with 5 groups. From this to further future, I learned the structure of project with upper figure.

Secondly, I tried to visualize the inheritance of each class. On the Visual Studio, we cannot see this inheritance clearly. With the experience of drawing upper figure, I practiced the script planning for the future when participate the team project.

C# grammar (#define, #if, #region)

From the references of C# grammar, such as int, string and List, we can see the structure of mainbody. However, my interests focused on the grammar which i have not studied. The #region is one of them. The preprocessor can be written with the # on the prefix. and this works like general C# grammar. The difference of preprocessor is the convenience for the developer. Especially the #region in Visual Studio, we can fold the codes without comment out. This feature can be applied to the team project to show each tasks with the folded code block. The usage of #region is explained on the following code blocks.

#define DEBUG false

public void Main(string[] args)
{
  // when you want to check Debug, you can use this method
  #if DEBUG
  Console.WriteLine("Debug On");
  #endif
  
  // the following codes can be fold on the Visual Studio
  #region My tasks
  ...
  #endregion
  
  
}

profile
꿈이큰개발자지망생

0개의 댓글