상태 머신 동작(State Machine Behaviour)은 특별 스크립트 클래스입니다. 일반 Unity 스크립트(MonoBehaviours)를 개별 게임 오브젝트에 연결하는 것과 유사한 방법으로 StateMachineBehaviour 스크립트를 상태 머신에 개별 상태로 연결할 수 있습니다. 이렇게 하면 상태 머신이 특정 상태로 전환되거나, 상태를 종료하거나, 해당 상태로 유지될 때 실행할 코드를 작성할 수 있습니다. 따라서 상태를 테스트하거나 상태 변경을 감지하기 위해 로직을 직접 작성할 필요가 없습니다.
이 기능을 사용하는 몇 가지 예는 다음과 같습니다.
상태 머신 동작은 스크립트를 작성하고 게임 오브젝트에 추가하는 방법과 매우 유사한 방법으로 작성하여 상태에 추가할 수 있습니다. 상태 머신에서 상태를 선택한 다음, 인스펙터에서 “동작 추가” 버튼을 사용하여 기존 StateMachineBehaviour를 선택하거나 새로 만듭니다.
상태 머신 동작 스크립트는 애니메이터가 다른 상태(또는 하위 상태 머신)를 시작, 업데이트 및 종료할 때 호출되는 여러 이벤트에 대한 액세스 권한을 갖습니다. 또한 루트 모션 및 역운동학(IK) 호출을 처리할 수 있는 이벤트가 있습니다.
자세한 내용은 상태 머신 동작 스크립트 레퍼런스를 참조하십시오.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.