Unity 57

쓰레드 풀 & async ask 사용하기

int test_i; int counter = 400; void Start() { for(int i =0; i taskSource.SetResult(Test4Async().Result)); // 이 주석이 없다면 쓰레드들은 동시에 발동하지 않고 순차적으로 발동한다 // var result = await taskSource.Task; } } async Task Test4Async() { Debug.LogFormat("Test4Async Start {0}", Thread.CurrentThread.ManagedThreadId); test_i++; for (int i = 0; i < counter; i++) for (int j = 0; j < counter; j++) ; Debug.LogFormat("Delay..

Unity/기타 2019.09.17

클래스 상단에 입력되는 Attribute

[HelpURL("https://docs.unity3d.com/kr/current/ScriptReference/AddComponentMenu.html")] [AddComponentMenu("Test/AddComponentMenu_")] // Component 메뉴에 추가 [DisallowMultipleComponent] // 동일한 컴퍼넌트가 등록 안되게 한다. [ExecuteAlways] // 에디트 모드 혹은 플레이 모드일때 무언가 하기 위한. [RequireComponent(typeof(Rigidbody))] // 컴퍼넌트 추가시 특정 컴퍼넌트를 같이 추가 [SelectionBase] // 하위 오브젝트가 선택 되어도 이 컴퍼넌트 오브젝트가 선택 [SharedBetweenAnimatorsAttrib..