| guids | GUIDs of assets reference to be uploaded to CacheServer. |
Upload the asset dependency data to cache server.
This method uploads asset dependency map(GUIDtoGUIDs), collected by Editor, to the cache server so that these data can be retrieved in other non-Editor situations. *Must be used in conjunction with the latest version of the Tuanjie Accelerator, and requires the cache server host and namespace to be properly configured.
using UnityEditor; using UnityEngine; using System.Collections.Generic;
public class UploadAssetDependency: MonoBehaviour { [MenuItem("Source/UploadReference", false, 1)] private static void UploadReferenceForSelectedAssets() { GUID[] guids = new GUID[Selection.objects.Length]; for ( int i = 0; i < Selection.objects.Length; i++) { string path = AssetDatabase.GetAssetPath(Selection.objects[i]);
GUID fileID = new GUID(AssetDatabase.AssetPathToGUID(path)); guids[i] = fileID; }
CacheServer.UploadReference(guids); } }
Simply upload specific asset dependency data to the cache server.