분류 전체보기
-
IndexerC# 2019. 6. 6. 11:00
What is Indexer? Indexer is a structure that makes it possible to deal with class as array by accessing array. Indexer is a structure that makes it possible to deal with class as array by accessing array in object. Indexer is consisted of "get" accessor and "set" accessor just like property. definition of Indexer Indexer is defined as, read only indexer when set accessor is not specified. write ..
-
C# polymorphism (1/4) - OverloadingC# 2019. 6. 5. 19:51
메서드 오버로딩 메서드의 이름은 같지만 아규먼트의 개수나 타입 도는 ref, out, params와 같은 키워드의 유무에 따라 다른 메서드가 생기는데, 이것을 오버로딩(Oberloading)이라 한다. public static void Clear(int[] m) //기존 메서드 { Array.Clear(); } public static void Clear(int[] m, int n) //오버로딩된 메서드 { for (int i = 0; i
-
Stack , HeapC# 2019. 6. 1. 17:36
What is "Stack" -A Memory space to run a program, memory which is needed when calling method is saved here. Stack Frame -A memory for calling method is mandatory in stack. A bundle of memory that are needed for a method is called "Stack Frame". -In other words, each method demands each Stack Frame which is consisted of local value, parameter, return value. Method Call and Stack Memory -When you ..
-
Boxing, UnBoxingC# 2019. 5. 30. 20:44
*Boxing(박싱) Boxing is defined to transforming value type to reference type and data which is in Stack is copied to Heap. In accordance with following example, When interger data int is allocated to object, Boxing automatically occurs. int i = 123; object o = i; //Boxing(implicit transform) integer data '123' is replicated to Heap which object o points. value type is converted to reference type.I..
-
20FEB19 NavMeshAgentC#/Unity 2019. 2. 20. 21:13
대충 plane 과 cube로 땅과 장애물을 만들고 1) static 설정, 2) window>>AI>>Navigation 컴포넌트를 추가해 3) Bake 한다. - 이 과정이 되게 오래걸린다. 맵 Scale 을 줄이면 시간을 줄일 수 있다고 한다. 파란색 큐브는 Human, 빨간색은 지렁이이다. Human 은 간단한 코드로 화살표로 움직일 수 있도록 하자. 지렁이에는 Add Component>>Nav Mesh Agent를 추가한다. 변수는 다음과 같다. acceleration 최대 가속도를 나타냅니다. angularSpeed 최대 회전 속도를 나타냅니다. (deg/s 단위). areaMask 이동할 수 있는 NavMesh 영역을 지정합니다. /areaMask/를 변경하면, 경로의 효율이 나빠지게 됩니다..
-
19FEB19 길찾기-A* algorithmC#/Unity 2019. 2. 19. 23:00
격자에서 8가지 움직일 수 있는 방향(노드) 가 있다. 이중 가로세로로 이동에는 travel cost 를 10, 대각선 이동에는 14로 지정한다. 이값은 직각이등변 삼각형의 변의 길이의 비가 1:1:√2 이기 때문에 근삿값으로 지정한 것. 최단경로를 찾기 위해선 이 travel cost를 최소화해야 한다. 이 과정에는 10가지 정보를 다룬다. 1 Node number : 움직일 수 있는 모든 경로의 격자마다 숫자를 붙인다. 2. X and Y Coords : x 와 y 좌표. 3. G-Cost : start node 에서 current node 까지의 travel cost 이다. 초록점 : start node 파란점 : current node 빨간점 : end node 검은점 : obstruction n..