Version: 2021.1

AssetDatabase.GetCurrentCacheServerIp

切换到手册
public static string GetCurrentCacheServerIp ();

返回

string 返回当前缓存服务器 IP 地址的字符串表示形式。

描述

获取 Editor 当前使用的缓存服务器的 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!"); } }