본문 바로가기

TOOL

Unreal 타입 이름 규칙 Unreal의 일반적인 클래스들의 최상위 클래스는 UObject class이다. Prefix 이름 규칙, Unreal의 모든것은 Pascal Case 사용(첫자는 대문자) U : UObject 상속받은 classex) UTexture A : AActor 상속받은 classex) AGameMode F : 그 이외의 모든 class, struct들ex) FName, FVector T : Templateex) TArray, TMap I : Interface classex) ITransaction E : Enum ex) ESelectionMode b : Booleanex) bEnabled
Unity 문제 어느것이 더 빠른가? 1. 1천개의 MonoBehaviour를 상속받는 GameObject의 Update 처리2. MonoBehaviour를 상속받는 GameObject 하나에 천개의 Class array가 있고 그 class array요서 각각의 커스텀 Update Callback 처리 정답 : Unity의 Update는 Reflaction을 이용하기 때문에 Direct Call보다 느리다. Unity에서 Start, Update, FixedUpdate, Destroy, OnTrigger 등은 Override해서 작동시키는게 아니다.즉, MonoBehaviour의 다형성을 이용하는 구조가 아니다. 참고https://cliwo.tistory.com/9?category=739025
Draw call / Batch Draw call CPU가 GPU에게 Scene을 한번 그려라 라는 명령을 내리는 것이라 보면 된다.Draw call은 CPU메모리를 많이 먹으므로 이 횟수를 줄이는 것이 최적화에 중요하다. Batch Unity에서는 기존에 Draw call이라는 것을 사용하다 5버전부터 Batch라는 단어로 대신 사용한다.Batching 과 Draw call은 개념상 다르나 결국 1회의 Batching이 끝나면 1회의 Draw call이 발생하기때문에Draw call 횟수 = Batching 횟수 이기 떄문에 단어의 차이일 뿐 의미는 같다고 볼 수 있다. 예를들어 Command Buffer상의 SetState( ) 호출작업, 그려질 Triangle의 정보들을 셋팅하는 작업, Rendering State를 셋팅하는 작업..
Frame 고정값 셋팅 Application.targetFrameRate 값을 설정해주면 해당 Frame값으로 고정이 된다. 대신 frame 고정을 사용할땐 QualitySettings.vSyncCount = 0; 으로 vSync를 사용하지 않아야 한다. //60 frame으로 고정 Application.targetFrameRate = 60; //vSync Off QualitySettings.vSyncCount = 0;
Scriptable Object Scriptable Object Unity에서 Script를 Component형식으로 사용하지 않고 Script자체를 Object로 사용하는 방식이다.기존의 XML이나 JSON을 대신해서 데이터를 일정 고정값으로 보관하고 있다가 해당 data가 필요할 때Scriptable Object를 new 하지 않고 data를 사용할 수 있다. 일종의 data만 가지고 있는 object를 사용하기 위해 있는 것이다.해당객체는 생성시 new가 아닌 CreateInstance를 사용해야 한다. public class BuildSetting : ScriptableOjbect { [SerializeField, Tooltip("빌드 결과물(apk 파일의 이름")] private string m_buildName = "Game..
Mobile Build 과정(Dalvik / ART / dex file / OAT file / NDK / JRE / JDK / JNI / Clang / LLVM / Library) Dalvik 롤리팝 이전부터 사용되었던 VM(virtual machine) ART(Android Run Time) 롤리팝버전부터 사용되는 VM(virtual machine) dex file virtual machine에서 bite code로 사용하는 file OAT(Optimized Ahead of Time) File Application이 처음 설치될때 생성되는 file, dex file을 dex2opt program을 통해 odex(Optimized dex)라는 최적화된 dex file로 바꿔서 사용한다.이와 비슷하게 dex2oat program은 dex file을 바아 oat file을 만든다.dex2oat program은 android OS 내부에 설치되어 있으며 처음 apk file을 설치될때 ..
LLVM / clang Complier Compiler는 보통 Frontend, Optimzer, Backend의 3가지 구성요소를 가지고 있다. 일반적인 Compiler 구조 Frontend Lexical(어휘분석), syntax analysis(구문분석), Semantic analysis(의미분석), Immediate code generation(중간코드 생성)source code parsing, error check, Language에 맞는 Abstract Syntax Tree(AST)작성 Optimizer runtime시 성능 향상을 위해 중복계산 제거 및 기타 여러 변환 실행 Backend 각 code를 target architecture에 맞는 instruction set으로 매핑해 실행code 생성 하지만 일반적인..
Coroutine / IEnumerator / IEnumerable StartCoroutine( ) StartCoroutine의 내부를 까보니StartCoroutine_Auto로 수행되고해당함수는 숨겨져있어서 볼수가 없다.아마 C++로 내부적으로 처리하는거같은데.. IEnumerator IEnumerator 는 C++의 iterator같은 것이다.인자값에 ref나 out을 사용할 수 없다. IEnumerator SomeNumbers() { Debug.Log("3"); yield return 3; Debug.Log("5"); yield return 5; Debug.Log("8"); yield return 8; } IEnumerator enumerator; void Start () { enumerator = SomeNumbers(); object cur; cur = enum..