guids | GUIDs of assets to be queried on cache server. |
checkAllRevisions | Specify whether all artifact revisions of the asset kept by editor will be queried from cache server. If false, only current artifact revision will be queried. |
bool Returns true if all artifacts of specified assets exist on cache server.
Check existence of aritifacts on cache server with given GUID of the asset.
This method checks existence of remote artifacts of specified assets(with given GUIDs) from cache server. More details of the query will be recorded in Editor Log.
using UnityEditor; using UnityEngine;
public static class RemoteCacheCheck { // check existence of the remote cache for the selected asset [MenuItem("Assets/Check Remote Cache", false, 21)] private static void CheckRemoteCache() { string path = AssetDatabase.GetAssetPath(Selection.objects[0]);
if (!string.IsNullOrEmpty(path)) { string fileID = GetFileID(path); GUID[] guids = { new GUID(fileID) }; if (CacheServer.CheckArtifacts(guids, false)) { Debug.Log($"Remote cache exists for: {path}"); AssetDatabase.Refresh(); } else { Debug.LogWarning($"Remote cache does not exist for: {path}"); } } }
private static string GetFileID(string path) { return AssetDatabase.AssetPathToGUID(path); } }