Action disabled: source

Using Animation Events

Animation View는 사용자가 Animation EventsAnimation Clips에 추가하도록 할 수 있습니다. Animation Events는 사용자가 애니메이션을 재생하는 것의 일환으로 SendMessage와 유사한 스크립트 함수를 부를 수 있게 합니다

Animation Events 는 파라미터를 자기고 있지 않거나 혹은 한 개만 가지고 있는 함수를 지원합니다. 그 파라미터는 float, string, object reference 또는 AnimationEvent 일 수 있습니다. AnimationEvent를 파라미터로 취하는 함수의 경우에 float, string 그리고 object reference가 지정될 수 있습니다. 이러한 세가지는 AnimationEvent의 멤버 변수로서 전달될 수 있습니다

// This JavaScript function can be called by an Animation Event
function PrintFloat (theValue : float) {
	Debug.Log ("PrintFloat is called with a value of " + theValue);
}

An Animation Event can be added to an Animation Clip at the currently previewed frame by clicking the Event button or at any given frame by double-clicking the Event Line at the frame where the Animation Event should be. It is also possible to add an Animation Event by right-clicking the Event Line and select Add Event from the context menu. Once placed, Animation Events can be dragged around with the mouse. It is also possible to select multiple Animation Events to drag at once. Animation Events can be deleted by selecting them and pressing Delete, or by right-clicking on them and selecting Delete Event from the context menu.

Animation Event는 현재 미리보이는 프레임에서 Event button을 클릭하는 것에 의해 또는 어떠한 주어진 프레임에서든 Animation Event가 있어야만 하는 프레임에 있는 Event Line을 더블 클릭하는 것에 의해 Animation Clip에 추가될 수 있습니다. Event Line을 오른쪽 클릭하고 그 해당 메뉴에서 Add Event 를 선택하는 것에 의해 Animation Event를 추가하는 것 또한 가능합니다. 일단 자리를 잡게 되면, Animation Events를 마우스로 드래그할 수 있습니다. 한 번에 다수의 Animation Events를 선택하고 드래그하는 것 또한 가능합니다. Animation Events는 그들을 선택하고 Delete를 누르거나 또는 그들을 오른쪽 클릭하여 해당 메뉴에서 Delete Event를 선택하는 것에 의해 삭제되어 질 수 있습니다


Animation EventsEvent Line에서 보입니다. Event Line을 오른쪽 클릭하거나 Event button을 사용해서 새로운 애니메이션을 추가하세요.

Animation Event를 추가하는 것은 Event Line에 하나의 표시(marker)를 추가하게 되고 하나의 Animation Event 다이아로그를 열게 됩니다. 그 다이아로그에서 사용자는 어떤 스크립트 함수를 부를 것인지를 지정할 수 있고 그 함수로 전달되는 파라미터 값을 기입할 수 있습니다


Animation Event 팝업창은 사용자가 어떤 함수를 부를지를 지정할 수 있도록 하고 파라미터 값들을 기입할 수 있도록 합니다.

Animation Clip에서 모든 Animation EventsEvent Line에서 표시(markers)로서 보여집니다. 사용자는 그 표시(markers) 위에 마우스 커서를 가져다 놓음으로서 특정 Animation Event가 무엇을 하는지를 빠르게 살펴볼 수 있습니다.


Animation Event marker위에 마우스 커서를 가져다 놓으면 파라미터 값 뿐만 아니라 그것이 어떠한 함수를 부르는 지도 보여줄 것입니다.

역링크