guids | Array of GUIDs to upload to the CacheServer after OnPostprocessAllAssets execution or Editor exit. |
immediate | Controls when upload occurs: `true`: Immediately uploads the specified GUIDs array upon completion of the OnPostprocessAllAssets event. `false`: Uploads all assets persisted to disk during Editor shutdown, ignoring the GUIDs array. |
Queues specified assets for upload to the CacheServer while providing precise control over upload timing behavior.
using UnityEditor; using UnityEngine;
public class CustomAssetPostprocessor : AssetPostprocessor { private static void OnPostprocessAllAssets( string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { var guids = new GUID[importedAssets.Length]; int index = 0; foreach (string assetPath in importedAssets) { if (assetPath.EndsWith(".prefab")) { guids[index] = AssetDatabase.GUIDFromAssetPath(assetPath); index++; } } CacheServer.DelayUpload(guids, true); // process each imported asset ... } }