Unity2015. 7. 30. 23:26
Unity/Notes2015. 7. 22. 04:46
* C/C++과 구조체 비교 (마샬링, System.Runtime.InteropServices)
C/C++
- struct A
- {
- int dBuffer[16];
- };
C#
- struct A
- {
- [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 16)]
- int[] dBuffer;
- };
* 인터페이스 적용 여부 테스트
IBlah myTest = originalObject as IBlah
if (myTest != null)
if (object is IBlah)
if( typeof(IMyInterface).IsAssignableFrom(someOtherType) ) { }
*
Unity/Notes2015. 7. 21. 23:53
* Asset Store에서 다운받은 파일 경로
C:\Users\accountName\AppData\Roaming\Unity\Asset Store
* GameObject instantiate : Instantiate( ) -> GameObject:Awake()
* Editor: Scene창에 글자출력
1 2 3 4 5 6 7 | public void OnSceneGUI() { GUIStyle style = new GUIStyle(); style.normal.textColor = Color.red; Handles.Label(Vector3.zero, "Test Label", style); } | cs |
- Rich Text로 출력
1 2 3 4 5 6 | public void OnSceneGUI() { GUIStyle style = new GUIStyle(); style.richText = true; GUILayout.Label("<size=30>Some <color=yellow>RICH</color> text</size>", style); } | cs |
* Monobehaviour::Awake() - active 되어야 호출된다. ( SetActive(true)에서 활성화후 호출할 수 있다.)
* Sprite vs. Mesh : 기본 Sprite Editor가 있어 추가 리소스 편집이 편하다.