Merge pull request #88183 from Repiteo/ref-instantiate-params
Allow Ref `instantiate` to accept constructor args
This commit is contained in:
commit
75a8c8a708
@ -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
Block a user