版本:Unity 6(6000.0)
语言中文
  • C#

AssetDatabase.RefreshSettings

建议更改

成功!

感谢帮助我们改善 Unity 文档的质量。虽然我们无法接受所有提交,但我们会阅读每个来自用户的建议更改,并在适用情况下进行更新。

关闭

提交失败

由于某些原因,您的建议更改无法提交。请在几分钟后<a>重试</a>。感谢花时间帮助我们改善 Unity 文档的质量。

关闭

取消

声明

public static void RefreshSettings();

说明

将挂起的编辑器设置更改应用到资源管道。

立即将所有更改应用到缓存服务器的 EditorSettings 属性中。如果没有进行调用,则直到重新启动编辑器才会对这些设置的更改生效。

需要调用 RefreshSettings 才能应用的设置列表

• EditorSettings.cacheServerNamespacePrefix

• EditorSettings.cacheServerMode

• EditorSettings.cacheServerEndpoint

• EditorSettings.cacheServerEnableTls。

using UnityEngine;
                        using UnityEditor;

public class AssetDatabaseExamples : MonoBehaviour

{ [MenuItem("AssetDatabase/Set Cache Server Project Settings")] static void SetCacheServerProjectSettings() { EditorSettings.cacheServerMode = CacheServerMode.Enabled; Debug.Log("Is Cache Server enabled? - " + AssetDatabase.IsCacheServerEnabled());

EditorSettings.cacheServerEndpoint = "192.168.31.210:10443"; Debug.Log("Cache Server IP and Port number: " + AssetDatabase.GetCacheServerAddress() + ":" + AssetDatabase.GetCacheServerPort());

EditorSettings.cacheServerEnableAuth = false; EditorSettings.cacheServerEnableTls = false;

EditorSettings.cacheServerEnableDownload = true; Debug.Log("Is Cache Server download enabled? - " + AssetDatabase.GetCacheServerEnableDownload());

EditorSettings.cacheServerEnableUpload = true; Debug.Log("Is Cache Server upload enabled? - " + AssetDatabase.GetCacheServerEnableUpload());

EditorSettings.cacheServerNamespacePrefix = "default"; Debug.Log("Cache Server Namespace prefix: " + AssetDatabase.GetCacheServerNamespacePrefix());

//This command is required to apply changes to some of the EditorSettings properties above AssetDatabase.RefreshSettings(); } }