32 static std::map<_u::Type*, _v::MonoPtr<FlowCoordinator>> m_Instances;
35 template<
class t_Base>
requires(std::is_assignable_v<FlowCoordinator*&, t_Base*>)
38 auto l_Type =
reinterpret_cast<_u::Type*
>(csTypeOf(t_Base*));
39 if (l_Type && m_Instances.contains(l_Type))
42 auto l_Ptr =
reinterpret_cast<t_Base*
>(_u::GameObject::New_ctor(
"[CP_SDK.UI.FlowCoordinator<" + l_Type->get_FullName() +
">]", ArrayW<_u::Type*>({
44 }))->GetComponent(l_Type));
45 _u::GameObject::DontDestroyOnLoad(l_Ptr->get_gameObject());
47 m_Instances[l_Type] = l_Ptr;
50 template<
class t_Base>
requires(std::is_assignable_v<FlowCoordinator*&, t_Base*>)
51 static void _Destroy()
53 auto l_Type =
reinterpret_cast<_u::Type*
>(csTypeOf(t_Base*));
54 auto l_It = m_Instances.find(l_Type);
55 if (!l_Type || l_It == m_Instances.end())
58 if (m_Instances[l_Type])
59 _u::GameObject::Destroy(m_Instances[l_Type]->get_gameObject());
61 m_Instances.erase(l_It);