Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- TOPCIT 후기
- 백준
- 백준 10844번 c++
- 2644번
- bfs
- 코드
- 배열 stack overflow
- 플레이어 이동
- 차이
- long int 의 차이
- 풀이
- 유니티 Rigidbody 이동
- transform.position
- 백준 2193번 c++
- rigidbody.position
- rigidbody.Moveposition
- TOPCIT 문제 유형
- 프로그래머스 단체사진 찍기 C++
- 백준 2225번 c++
- 백준 11726번 C++
- 로블록스 script local script 차이
- 유니티
- 유니티 LTS
- c++
- 백준 17299번 c++
- 유니티 꿀팁
- 1699번
- 백준 10799번 c++
- 프로그래머스 가장 큰 수 C++
- UML Diagram 정리
Archives
- Today
- Total
Kiki Devlog
출력문 본문
728x90
Console.WriteLine() / Console.Write()
- 이 두 함수는 unity engine에서는 아무 일도 하지 않음. (unity는 custom console system을 사용하기 때문) 그러니까 UnityEngine.Debug.Log / LogError / LogWarning 등을 사용하자
- 두 함수의 차이는 WriteLine 은 새로운 라인에 출력한다는 점이다.
( c++의 "\n", endl 과 같은 역할. Write() 에서 줄바꿈 기능이 추가됨. )
[참고]
Why doesn't Console.WriteLine work in MonoDevelop since it's written in C#? - Unity Answers
Difference between Console.Write and Console.WriteLine in C# - GeeksforGeeks=
Debug.Log()
: 디버그에서 실행할 때만 기록. (릴리즈 된 게임에서는 실행되지 않음)
(Console.WriteLine 은 디버그 또는 릴리스에서 표준 출력 스트림에 쓴다. Debug.WriteLine 은 Listeners 컬렉션 의 추적 수신기에 기록 하지만 디버그에서 실행할 때만 기록됨 . 응용 프로그램이 릴리스 구성에서 컴파일 될 때 Debug 요소는 코드로 컴파일되지 않는다.)
[참고]
.net - What's the difference between Console.WriteLine() vs Debug.WriteLine()? - Stack Overflow
사용 예시
using System;
// Console.WriteLine 과 Console.Write를 사용하기 위함
// 아니면 System.Console.WriteLine으로 사용가능.
Console.WriteLine("Hello World!");
Console.Write(("Hello World!");
Debug.Log(("Hello World!");
Comments