string 返回当前缓存服务器 IP 地址的字符串表示形式。
获取编辑器当前使用的缓存服务器的 IP 地址。
using UnityEditor; using UnityEngine;
public class AssetDatabaseExamples : AssetPostprocessor { static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { //Throw a warning in the console if Cache Server IP is not set or could not be connected to if(AssetDatabase.GetCurrentCacheServerIp() == "") Debug.LogWarning("Cache Server IP is not set!"); } }