- Home /
How to use cache-server to share imports with other team members?
I am creating a large number of meshes procedurally. I then save these meshes to a project folder using a workflow as such:
AssetDatabase.StartAssetEditing();
// loop over a few meshes and add using the following line
AssetDatabase.CreateAsset(my_mesh, "path/to/mesh.asset");
// wrap up
AssetDatabase.StopAssetEditing();
Firstly, in order to see these synced to the cache-server, I find that I have to reimport all items in the folder. Is there a simpler or automatic way to do this in the script itself?
The next issue is that I am unsure how to actually propagate the new meshes to other team members. I have tried the following in the hopes that this would prompt a lookup to the cache-server:
Mesh cached_mesh;
// try to load the mesh in case it already exists in the local folder
cached_mesh = AssetDatabase.LoadAssetAtPath<Mesh> ("path/to/mesh.asset");
if (cached_mesh) {
return cached_mesh;
} else {
// otherwise, try to fetch or force import from cache server
AssetDatabase.ImportAsset ("mesh.asset");
cached_mesh = AssetDatabase.LoadAssetAtPath<Mesh> ("path/to/mesh.asset");
if (cached_mesh) {
Debug.Log ("FOUND ONE!!!");
return cached_mesh;
}
}
However, this doesn't seem to work, and I get an error saying that "mesh_name.asset does not exist".
Your answer
![](https://koobas.hobune.stream/wayback/20220611233601im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can I avoid re-importing assets? 3 Answers
Load image from server 0 Answers
How I can install Unity Cache Server as Windows Service on 2012 Server R2? 1 Answer
Cache server works only partially 0 Answers
How to fix this error "Cache server is enabled, but endpoint string is not valid " ? 0 Answers