55 {
56 AssetMgr::TYPE type = asset->type;
57 std::string path = asset->name_path;
58
59 switch (type) {
60 case AssetMgr::DAE:
61 DAELoader::GeneratePrefab(path.c_str(), nullptr, nullptr, nullptr, this);
62 break;
63 }
64
65 std::string hashRaw = AssetMgr::LoadAssetFile(path + ".meta");
66 if(!hashRaw.empty()) {
67 const XNode* root =
XFILE().loadBuffer(hashRaw);
68 const auto& hashData = root->getNode("hash-data");
69 std::string hash = hashData.getAttribute("hash").value;
70 SetHash(hash);
71 const auto& hashChildren = hashData.children;
72
73 if(hashData.children.size() <= 0) {
74 hashRaw = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
75 "<CSEMETA version=\"1.0.0\">\n"
76 "<hash-data hash=\"" + m_hash + "\">\n"
77 + m_root->GenerateMeta() +
78 "\n</hash-data>\n</CSEMETA>";
79 SaveTxtFile(path + ".meta", hashRaw);
80 }
81 else {
82 for(const auto& child : hashChildren) {
83 const auto& id = child.getAttribute("id").value;
84 std::string hash = child.value;
86 if(obj == nullptr) continue;
87 obj->SetHash(hash);
88 obj->SetRefHash(hash);
89 }
90 }
91 SAFE_DELETE(root);
92 }
93 GenerateResourceID();
94}