Hello, I'm looking at the templated functions tests as a source for my code. I want to achieve something like this: Scene::GetComponent<TransformComponent>()
However, if I understand correctly, I can only get the templated type using the argument, which would mean that I need to provide an empty instance of TransformComponent in the parameter?
void GetComponent(asIScriptGeneric* gen)
{
auto* engine = // ...
auto id = gen->GetArgTypeId(0); // this returns 0 :(
asITypeInfo* typeInfo = engine->GetTypeInfoById(id);
Log::Info("{}", typeInfo->GetName());
gen->SetReturnObject(nullptr);
}Maybe I am misunderstanding, but I simply want to register this: T@ GetComponent<T>() and get the typeinfo of the provided type. Is that possible with how the templated functions are implemented?
Thanks!