Version: 2022.3
言語: 日本語

AssetDatabase.cacheServerConnectionChanged

マニュアルに切り替える

パラメーター

value Use CacheServerConnectionChangedParameters for this event.

説明

Unity raises this event when Cache Server connection is changed.

using UnityEngine;
using UnityEditor;

public class CacheServerConnectionChangedExample { [MenuItem("AssetDatabase/Correct connection to the Cache Server")] static void CorrectChangeCacheServer() { var correctEndpoint = "192.168.1.210:8080"; EditorSettings.cacheServerEndpoint = correctEndpoint; AssetDatabase.RefreshSettings(); }

[MenuItem("AssetDatabase/Wrong connection to the Cache Server")] static void WrongChangeCacheServer() { var invalidEndpoint = "Invalid IP Address"; EditorSettings.cacheServerEndpoint = invalidEndpoint; AssetDatabase.RefreshSettings(); }

[InitializeOnLoadMethod] static void OncacheServerConnectionChanged() { AssetDatabase.cacheServerConnectionChanged += ConsoleLog; }

static void ConsoleLog(CacheServerConnectionChangedParameters param) { Debug.Log("Connection Changed"); } }