This commit is contained in:
aozhiwei 2023-02-07 11:31:58 +08:00
parent 1e6215b4e2
commit 1986c74400
3 changed files with 28 additions and 0 deletions

View File

@ -16,6 +16,24 @@ namespace mt
return itr != name_hash.end() ? itr->second : nullptr;
}
void MapCollider::StaticPostInit()
{
}
void MapCollider::LoadAll()
{
std::vector<std::string> files = {
"main3d_map.colliders.json"
};
for (auto& filename : files) {
MapCollider* p = new MapCollider();
p->Load(filename);
raw_list.push_back(p);
name_hash[filename] = p;
}
}
void MapCollider::Load(const std::string& filename)
{
a8::XObject xobj_root;

View File

@ -14,6 +14,9 @@ namespace mt
public:
static MapCollider* GetByName(const std::string& name);
static void StaticPostInit();
static void LoadAll();
public:

View File

@ -34,6 +34,7 @@
#include "mt/Skill.h"
#include "mt/SkillNumber.h"
#include "mt/MapArea.h"
#include "mt/MapCollider.h"
#include "app.h"
@ -106,6 +107,9 @@ namespace mt
itr->static_pre_init_cb();
itr->load_cb();
}
{
mt::MapCollider::LoadAll();
}
for (size_t i = 0; i < 3; ++i) {
for (auto& itr : meta_tables) {
if (i < itr->init_cbs.size()) {
@ -116,6 +120,9 @@ namespace mt
for (auto& itr : meta_tables) {
itr->static_post_init_cb();
}
{
mt::MapCollider::StaticPostInit();
}
}
void MetaMgr::UnInit()