Allow Ref `instantiate` to accept constructor args
This commit is contained in:
parent
4e990cd7e5
commit
b3cac9c092
|
@ -665,7 +665,7 @@ RemoteDebugger::RemoteDebugger(Ref<RemoteDebuggerPeer> p_peer) {
|
|||
// Performance Profiler
|
||||
Object *perf = Engine::get_singleton()->get_singleton_object("Performance");
|
||||
if (perf) {
|
||||
performance_profiler = Ref<PerformanceProfiler>(memnew(PerformanceProfiler(perf)));
|
||||
performance_profiler.instantiate(perf);
|
||||
performance_profiler->bind("performance");
|
||||
profiler_enable("performance", true);
|
||||
}
|
||||
|
|
|
@ -212,8 +212,9 @@ public:
|
|||
reference = nullptr;
|
||||
}
|
||||
|
||||
void instantiate() {
|
||||
ref(memnew(T));
|
||||
template <typename... VarArgs>
|
||||
void instantiate(VarArgs... p_params) {
|
||||
ref(memnew(T(p_params...)));
|
||||
}
|
||||
|
||||
Ref() {}
|
||||
|
|
Loading…
Reference in New Issue