ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
Loading...
Searching...
No Matches
ListCellPrefabs.hpp
1#pragma once
2
3#include "IListCell.hpp"
4
5#include <memory>
6
7namespace CP_SDK::UI::Data {
8
9 namespace _u
10 {
11 using namespace System;
12 using namespace UnityEngine;
13 }
14 namespace _v
15 {
16 using namespace CP_SDK::Utils;
17 }
18
21 template<class t_ListCellType>
23 {
24 private:
25 static _v::MonoPtr<t_ListCellType> m_Prefab;
26
27 public:
28 IListCell* Cell();
29
30 public:
32 static t_ListCellType* Get()
33 {
34 if (m_Prefab)
35 return m_Prefab.Ptr();
36
37 m_Prefab = _u::GameObject::New_ctor(std::string(classof(t_ListCellType*)->name) + "ListCellPrefab", ArrayW<_u::Type*>({
38 reinterpret_cast<_u::Type*>(csTypeOf(_u::RectTransform*)),
39 reinterpret_cast<_u::Type*>(csTypeOf(t_ListCellType*))
40 }))->GetComponent<t_ListCellType*>();
41
42 _u::GameObject::DontDestroyOnLoad(m_Prefab->get_gameObject());
43 m_Prefab->get_gameObject()->SetActive(false);
44
45 return m_Prefab.Ptr();
46 }
47
48 };
49
50 template <typename t_ListCellType> _v::MonoPtr<t_ListCellType> ListCellPrefabs<t_ListCellType>::m_Prefab;
51
52}
Abstract List Cell component.
Definition IListCell.hpp:38
static t_ListCellType * Get()
Get prefab.
< namespace CP_SDK::UI::Components
Definition IListCell.hpp:20
Various platform utils like Delegate/Action/Function/Event system.
Definition Delegate.hpp:8