Unity2015. 7. 30. 23:26

Physical movements of hair and skirt with sprite-skewing



Using a custom sprite shader, hair and skirt are physically animated. All sprites are batched by the Unity3D's default sprite batching system. 


Sprite Skew 테스트. 캐릭터 애니메이션. 2D 스프라이트. 유니티







Posted by GNUPart
Unity/Notes2015. 7. 22. 04:46

* C/C++과 구조체 비교 (마샬링, System.Runtime.InteropServices)


C/C++

  1. struct A   
  2. {   
  3.    int dBuffer[16];   
  4. }; 


C#

  1. struct A   
  2. {   
  3.    [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 16)]
  4.    int[] dBuffer;
  5. }; 



* 인터페이스 적용 여부 테스트

IBlah myTest = originalObject as IBlah

if (myTest != null)


if (object is IBlah)


if( typeof(IMyInterface).IsAssignableFrom(someOtherType) ) { }


*



Posted by GNUPart
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가 있어 추가 리소스 편집이 편하다.

Posted by GNUPart