Is there a way to pass aditional parameters into custom c++ Components eg i have this component:
class MyComponent : public LogicComponent // or Component whatever
{
URHO3D_OBJECT(MyComponent , LogicComponent)
public:
MyComponent(Context* context,int foo,int bar)
...
...
...
}
is there a way i could create the component in a node with some additional parameters like this:
node->CreateComponent<MyComponent>(CreateMode::REPLICATED, 0, 123, 456); //last 2 are the additional parameters
i know i could create the component with
MyComponent* comp = new MyComponent(context_,123,456)
and then add it to the node like this
node->AddComponent(comp, 0, CreateMode::REPLICATED);
but its kinda ugly and i would prefere variadic templates
like its done in std::make_shared