private void OnRemoveDCCToolButtonClicked(EventBase evt) { DCCToolInfo dccToolInfo = GetEventButtonUserDataAs <DCCToolInfo>(evt.target); if (null == dccToolInfo || string.IsNullOrEmpty(dccToolInfo.AppPath)) { Debug.LogWarning("[MeshSync] Failed to remove DCC Tool"); return; } MeshSyncEditorSettings settings = MeshSyncEditorSettings.GetOrCreateSettings(); if (settings.RemoveDCCTool(dccToolInfo.AppPath)) { //Delete install info too string installInfoPath = DCCPluginInstallInfo.GetInstallInfoPath(dccToolInfo); if (File.Exists(installInfoPath)) { DCCPluginInstallInfo installInfo = FileUtility.DeserializeFromJson <DCCPluginInstallInfo>(installInfoPath); installInfo.RemovePluginVersion(dccToolInfo.AppPath); FileUtility.SerializeToJson(installInfo, installInfoPath); } if (!m_dccContainers.TryGetValue(dccToolInfo.AppPath, out VisualElement container)) { SetupInternal(m_root); return; } container.parent.Remove(container); //Remove the VisualElement container from the UI } }
void OnRemoveDCCToolButtonClicked(EventBase evt) { Button button = evt.target as Button; if (null == button) { Debug.LogWarning("[MeshSync] Failed to Remove DCC Tool"); return; } DCCToolInfo info = button.userData as DCCToolInfo; if (null == info || string.IsNullOrEmpty(info.AppPath)) { Debug.LogWarning("[MeshSync] Failed to Remove DCC Tool"); return; } MeshSyncEditorSettings settings = MeshSyncEditorSettings.GetOrCreateSettings(); if (settings.RemoveDCCTool(info.AppPath)) { //Delete install info too string installInfoPath = DCCPluginInstallInfo.GetInstallInfoPath(info); if (File.Exists(installInfoPath)) { File.Delete(installInfoPath); } Setup(m_root); } }