너무 잘 정리된 블로그가 있음.
예를들어 _char 이라는 GameObject를 이동하고 싶다면 아래와 같이 작성하면 된다.
Hashtable h = new Hashtable();
h.Add ("x", posChar.x);
h.Add ("y", posChar.y);
h.Add ("z", posChar.z);
h.Add ("time", 2);
iTween.MoveTo(_char, h);
자세한 사용법은 제작사 사이트에서 볼수 있음.
http://itween.pixelplacement.com/documentation.php
<첨부파일: iTween>
애셋 스토어가 접속이 되지 않을때를 대비하여 이곳에 올려둡니다. (지금도 접속이 안되네요.;;)
이렇게도 가능.
void OnRotateComplete(GameObject obj) {
nCnt++;
if (nCnt < fRotAngle.Length) {
Hashtable h = new Hashtable();
h.Add ("z", fRotAngle[nCnt]);
h.Add ("time", 0.1f);
h.Add ("oncompletetarget", obj);
h.Add ("oncomplete", "OnRotateComplete");
h.Add ("oncompleteparams", obj);
iTween.RotateTo(obj, h);
}
}
<참고: iTween의 해쉬 String >
Property Name | Type | Purpose |
---|---|---|
name | string | an individual name useful for stopping iTweens by name |
audiosource | AudioSource | for which AudioSource to use |
volume | float or double | for the target level of volume |
pitch | float or double | for the target pitch |
time | float or double | for the time in seconds the animation will take to complete |
delay | float or double | for the time in seconds the animation will wait before beginning 애니메이션 시작 전 대기 시간을 설정 한다. |
easetype | EaseType or string | for the shape of the easing curve applied to the animation 애니메이션에 적용할 완곡 곡선 설정 |
looptype | LoopType or string | for the type of loop to apply once the animation has completed |
onstart | string | for the name of a function to launch at the beginning of the animation |
onstarttarget | GameObject | for a reference to the GameObject that holds the "onstart" method |
onstartparams | Object | for arguments to be sent to the "onstart" method |
onupdate | string | for the name of a function to launch on every step of the animation |
onupdatetarget | GameObject | for a reference to the GameObject that holds the "onupdate" method |
onupdateparams | Object | for arguments to be sent to the "onupdate" method |
oncomplete | string | for the name of a function to launch at the end of the animation |
oncompletetarget | GameObject | for a reference to the GameObject that holds the "oncomplete" method |
oncompleteparams | Object | for arguments to be sent to the "oncomplete" method |
ignoretimescale | boolean | setting this to true will allow the animation to continue independent of the current time which is helpful for animating menus after a game has been paused by setting Time.timeScale=0 |
'Unity3D' 카테고리의 다른 글
SVN을 통해 Unity3D 프로젝트 관리하기 (0) | 2013.10.17 |
---|---|
이미지 버튼 적용하기 (0) | 2013.10.15 |
Animation 재생방법 (0) | 2013.10.14 |
[API] Scene 로드가 완료되었을때 호출되는 콜백함수 (0) | 2013.10.14 |
[Script] Raycast를 이용한 Picking (0) | 2013.10.14 |