use of org.terasology.logic.behavior.BehaviorComponent in project Terasology by MovingBlocks.
the class BehaviorEditorScreen method onAssignPressed.
private void onAssignPressed() {
if (selectedTree != null && selectedInterpreter != null) {
EntityRef minion = selectedInterpreter.actor().getEntity();
minion.removeComponent(BehaviorComponent.class);
BehaviorComponent component = new BehaviorComponent();
component.tree = selectedTree;
minion.addComponent(component);
List<Interpreter> interpreter = behaviorSystem.getInterpreters();
selectEntity.setSelection(null);
for (Interpreter i : interpreter) {
if (i.actor().getEntity() == minion) {
selectEntity.setSelection(i);
break;
}
}
}
}
Aggregations