コード例 #1
0
//----------------------------------------------------------------------------------------------------------------------

        #region CheckPluginUpdates Button callback
        private void OnCheckPluginUpdatesButtonClicked()
        {
            m_checkPluginUpdatesButton.SetEnabled(false);

            //Disable installing plugin while we are checking for updates
            foreach (Button installPluginButton in m_installPluginButtons)
            {
                installPluginButton.SetEnabled(false);
            }

            m_updateFooterStatusFinished = false;
            EditorCoroutineUtility.StartCoroutineOwnerless(UpdateFooterStatusLabel("Checking", FinalizeCheckPluginUpdates));

            PackageRequestJobManager.CreateSearchRequest("com.unity.meshsync.dcc-plugins", /*offline=*/ false, (packageInfo) => {
                //just in case
                if (packageInfo.Result.Length <= 0)
                {
                    Debug.LogError("[MeshSync] Failed to check DCC Plugin updates");
                    m_updateFooterStatusFinished = true;
                    return;
                }

                //Update status labels
                UpdateLatestCompatibleDCCPlugin(packageInfo.Result[0].versions);
                foreach (KeyValuePair <string, Label> kv in m_dccStatusLabels)
                {
                    UpdateDCCPluginStatusLabel(kv.Value);
                }

                m_updateFooterStatusFinished = true;
            }, (req) => {
                m_updateFooterStatusFinished = true;
            });
        }