owl-bt
Version:
owl-bt is editor for Behavior trees. It has been inspired by Unreal engine behavior trees in a way, that it supports special node items like decorators and services. This makes trees smaller and much more readable.
29 lines (25 loc) • 837 B
JavaScript
(function () {
'use strict';
angular.module('editorApp')
.directive('treeItemPalette', function (TreeSelection) {
return {
template: require('./treeItemPalette.html'),
restrict: 'E',
replace: true,
scope: {},
link: function (scope, element) {
scope.$watch(() => TreeSelection.selNode(), function () {
let selNode = TreeSelection.selNode();
scope.hasSelectedNode = selNode;
scope.selNodeIsComposite = selNode && selNode.$meta.desc.isComposite;
});
scope.compositeNodes = function (items) {
return items.filter(item => item.isComposite);
}
scope.actionNodes = function (items) {
return items.filter(item => !item.isComposite);
}
}
};
});
})();