use of org.terasology.engine.logic.behavior.asset.BehaviorTreeData in project Terasology by MovingBlocks.
the class CollectiveBehaviorSystem method createTree.
public BehaviorTree createTree(String name, BehaviorNode root) {
BehaviorTreeData data = new BehaviorTreeData();
data.setRoot(root);
BehaviorTree behaviorTree = assetManager.loadAsset(new ResourceUrn(BEHAVIORS, new Name(name.replaceAll("\\W+", ""))), data, BehaviorTree.class);
trees.add(behaviorTree);
save(behaviorTree);
return behaviorTree;
}
use of org.terasology.engine.logic.behavior.asset.BehaviorTreeData in project Terasology by MovingBlocks.
the class BehaviorSystem method createTree.
public BehaviorTree createTree(String name, BehaviorNode root) {
BehaviorTreeData data = new BehaviorTreeData();
data.setRoot(root);
BehaviorTree behaviorTree = assetManager.loadAsset(new ResourceUrn(BEHAVIORS, new Name(name.replaceAll("\\W+", ""))), data, BehaviorTree.class);
trees.add(behaviorTree);
save(behaviorTree);
return behaviorTree;
}
Aggregations