Skip to content

Commit

Permalink
fix(hierarchy): make sure all the hierarchy stuff is set up properly
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Jan 15, 2022
1 parent 6c64df4 commit 372c13e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ impl ActionBuilder for StepsBuilder {
active_ent: ActionEnt(child_action),
steps: self.steps.clone(),
})
.insert(Transform::default())
.insert(GlobalTransform::default())
.push_children(&[child_action]);
}
}
Expand Down Expand Up @@ -271,6 +273,8 @@ impl ActionBuilder for ConcurrentlyBuilder {
.collect();
cmd.entity(action)
.insert(Name::new("Concurrent Action"))
.insert(Transform::default())
.insert(GlobalTransform::default())
.push_children(&children[..])
.insert(Concurrently {
actions: children.into_iter().map(ActionEnt).collect(),
Expand Down
6 changes: 6 additions & 0 deletions src/scorers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ impl ScorerBuilder for AllOrNothingBuilder {
.collect();
cmd.entity(scorer)
.insert(Score::default())
.insert(Transform::default())
.insert(GlobalTransform::default())
.push_children(&scorers[..])
.insert(Name::new("Scorer"))
.insert(AllOrNothing {
Expand Down Expand Up @@ -273,6 +275,7 @@ impl ScorerBuilder for SumOfScorersBuilder {
cmd.entity(scorer)
.insert(Transform::default())
.insert(GlobalTransform::default())
.push_children(&scorers[..])
.insert(SumOfScorers {
threshold: self.threshold,
scorers: scorers.into_iter().map(ScorerEnt).collect(),
Expand Down Expand Up @@ -364,6 +367,7 @@ impl ScorerBuilder for WinningScorerBuilder {
cmd.entity(scorer)
.insert(Transform::default())
.insert(GlobalTransform::default())
.push_children(&scorers[..])
.insert(WinningScorer {
threshold: self.threshold,
scorers: scorers.into_iter().map(ScorerEnt).collect(),
Expand Down Expand Up @@ -431,9 +435,11 @@ pub struct EvaluatingScorerBuilder {
impl ScorerBuilder for EvaluatingScorerBuilder {
fn build(&self, cmd: &mut Commands, scorer: Entity, actor: Entity) {
let inner_scorer = self.scorer.spawn_scorer(cmd, actor);
let scorers = vec![inner_scorer];
cmd.entity(scorer)
.insert(Transform::default())
.insert(GlobalTransform::default())
.push_children(&scorers[..])
.insert(EvaluatingScorer {
evaluator: self.evaluator.clone(),
scorer: ScorerEnt(inner_scorer),
Expand Down

0 comments on commit 372c13e

Please sign in to comment.