사생활 보호 설정
https://gamjia.tistory.com
Updated News
Mini Rooms
답글수 [0]
What Friends Say
한마디로 표현해봐~
1촌평 관리
Unity, Cocos Animation Controller 비교
GamJia 2025. 1. 17. 23:12
오늘은 게임 개발에 빼놓을 수 없는Animation Controller에 대해 알아보겠습니다비슷한듯 다른 두 게임 엔진을 비교해서 설명드릴게요
Unity Animation Controller
Create > Animator Controller에서 생성 가능합니다Parameter는 Float, Int, Bool, Trigger 입니다https://docs.unity3d.com/kr/2021.3/Manual/class-AnimatorController.html
애니메이터 컨트롤러 - Unity 매뉴얼
애니메이터 컨트롤러를 사용하여 캐릭터나 오브젝트의 애니메이션 클립 세트와 관련 애니메이션 전환을 정렬하고 관리할 수 있습니다. 대부분의 경우, 여러 애니메이션을 이용하여 게임 내에
docs.unity3d.com
this.GetComponent<Animator>().SetFloat("Float", 1.0f); this.GetComponent<Animator>().SetInteger("Int", 1); this.GetComponent<Animator>().SetBool("Boolean", true); this.GetComponent<Animator>().SetTrigger("Trigger");
Unity는 Type별 Method로 세분화 되어 있습니다Type 안정성을 보장하며Type 오류를 줄일 수 있다는 장점이 있습니다
Cocos Animation Controller
Create > Animation Graph에서 생성 가능합니다Parameter는 Float, Int, Bool, Trigger, Vector 3D, Quaternion 입니다https://docs.cocos.com/creator/3.8/manual/en/animation/marionette/animation-controller.html
Cocos 같은 경우에 보면 Vector3D, Quaternion이 있는데이건 Animation Parameter로 쓰이는 값이지만직접 Transition(상태 전환)에 사용되기보다는Animation Clip 내에서 동적으로 위치와 회전을 조정하는 데 쓰입니다.
this.getComponent(animation.AnimationController).setValue('Float',1.0); this.getComponent(animation.AnimationController).setValue('Int',1); this.getComponent(animation.AnimationController).setValue('Boolean',true); this.getComponent(animation.AnimationController).setValue('Trigger',true); // Trigger도 Boolean처럼 true로 바꿔주세요
Cocos 같은 경우에 모든 Animation Parameter를setValue 하나로 처리 가능합니다Data Type을 신경 쓰지 않고 직관적으로 코드를작성할 수 있어 간편하다는 장점이 있습니다