We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f88951 commit 4afb1b0Copy full SHA for 4afb1b0
Foundation/Public/Aurora.Scene/Entity.hpp
@@ -483,6 +483,21 @@ namespace Scene
483
Actor.Children(& ToggleComponentInHierarchy<Component, Enable>);
484
}
485
486
+ // -=(Undocumented)=-
487
+ template<typename Component>
488
+ static void AddOrEnableComponentInHierarchy(Scene::Entity Actor)
489
+ {
490
+ if (Actor.Contains<Component>())
491
492
+ Actor.Enable<Component>();
493
+ }
494
+ else
495
496
+ Actor.Attach<Component>();
497
498
+ Actor.Children(& AddOrEnableComponentInHierarchy<Component>);
499
500
+
501
private:
502
503
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0 commit comments