이전 프로젝트에서 Behaviour Tree를 이용해서 몬스터 AI를 제작했었는데, Tree 구조를 코드로만 파악하기에는 어려움이 있었다.
AnimtorController처럼 에디터에서 Behaviour Tree의 구조를 확인하면서 제작을 하면 좋을 것 같다는 생각을 했었지만, 간단한 AI를 구현하는 것 치고 시간이 너무 오래 걸릴 것 같아서 포기했었다.
그래서 이번에는 시간도 되고 같은 기능을 만들어야 하니 이번 기회에 제대로 만들어보고자 한다.
에셋 스토어에도 있고,
Behavior Designer - Behavior Trees for Everyone | 비주얼 스크립팅 | Unity Asset Store
Get the Behavior Designer - Behavior Trees for Everyone package from Opsive and speed up your game development process. Find this & other 비주얼 스크립팅 options on the Unity Asset Store.
assetstore.unity.com
깃에도 코드 자체가 올라와 있어서 이 두개를 참고해서 만들기로 한다.
GitHub - thekiwicoder0/UnityBehaviourTreeEditor: Behaviour Tree Editor for Unity built with UIToolkit
Behaviour Tree Editor for Unity built with UIToolkit - thekiwicoder0/UnityBehaviourTreeEditor
github.com
코드 자체는 깃에 올라와 있는 코드를 기반으로 만들겠지만 대략적인 구조와 필요한 기능이 있을 때 참고하는 정도로만 사용할 예정이라 같은 코드가 있을수도, 아예 다른 코드가 있을 수도 있다.
GraphView를 이용해서 만들었고 Tree와 Node의 생성, 연결 기능을 만들었다.
하지만 Tree ScriptableObject 하위에 Node들을 ScriptableObject로 만들었더니 삭제가 안되는 문제가 발생했다.
원인을 찾아보니 개별 ScriptableObject가 아니라서 삭제가 불가능한 것 같다.
결론
ScriptableObject가 아닌 다른 형태로 저장하는 방식으로 변경해야 될 것 같다....
GitHub - mintchobab/Unity_Practice_Editor
Contribute to mintchobab/Unity_Practice_Editor development by creating an account on GitHub.
github.com
'Unity > 개발연습' 카테고리의 다른 글
[Unity] Behaviour Tree Editor 제작기 - 3 (0) | 2024.08.30 |
---|---|
[Unity] Behaviour Tree Editor 제작기 - 2 (0) | 2024.08.27 |
[Unity] 사이드 프로젝트 개발일지 (씬 전환 커스텀 에디터) (0) | 2024.07.19 |
[Unity] 사이드 프로젝트 개발일지 (이미지 퍼즐 만들기) (1) | 2024.07.03 |
[Unity] 포트폴리오 개발일지 - 11 (0) | 2022.08.15 |