//Post register fixups private static void onPostAdd() { foreach (var kv in models) { kv.Value.Preload(); PrefabDesc pdesc = kv.Value.prefabDesc; Material assMat = LDB.models.modelArray[65].prefabDesc.materials[0]; pdesc.lodMaterials[0][0] = assMat; VFPreload.SaveGameObjectResources(pdesc.prefab); VFPreload.SaveGameObjectResources(pdesc.colliderPrefab); VFPreload.SaveObject(pdesc.mesh); VFPreload.SaveMeshes(pdesc.meshes); VFPreload.SaveObject(pdesc.meshCollider); VFPreload.SaveMaterials(pdesc.materials); VFPreload.SaveMeshes(pdesc.lodMeshes); VFPreload.SaveMaterials(pdesc.lodMaterials); LDB.models.modelArray[kv.Value.ID] = kv.Value; } foreach (var kv in items) { kv.Value.Preload(kv.Value.index); } foreach (var kv in recipes) { kv.Value.Preload(kv.Value.index); } }
//Post register fixups private static void onPostAdd() { foreach (var kv in models) { kv.Value.Preload(); PrefabDesc pdesc = kv.Value.prefabDesc; if (pdesc.minerType == EMinerType.Vein) { pdesc.beltSpeed = 1; } Material[] mats = pdesc.materials; for (int i = 0; i < pdesc.lodMaterials[0].Length; i++) { pdesc.lodMaterials[0][i] = mats[i]; } VFPreload.SaveGameObjectResources(pdesc.prefab); VFPreload.SaveGameObjectResources(pdesc.colliderPrefab); VFPreload.SaveObject(pdesc.mesh); VFPreload.SaveMeshes(pdesc.meshes); VFPreload.SaveObject(pdesc.meshCollider); VFPreload.SaveMaterials(pdesc.materials); VFPreload.SaveMeshes(pdesc.lodMeshes); VFPreload.SaveMaterials(pdesc.lodMaterials); LDB.models.modelArray[kv.Value.ID] = kv.Value; } foreach (var kv in items) { kv.Value.Preload(kv.Value.index); } foreach (var kv in recipes) { kv.Value.Preload(kv.Value.index); } logger.LogInfo("Post loading is complete!"); }