void DoUpdates() { // Handle objects that need updating int objUpdateCount = m_ObjectUpdateQueue.Count; for (int i = 0; i < objUpdateCount; i++) { Object obj = m_ObjectUpdateQueue[i]; if (obj != null) { EditorUtility.SetDirty(obj); } } if (objUpdateCount > 0) { //Debug.Log("Saving assets"); //AssetDatabase.SaveAssets(); m_ObjectUpdateQueue.Clear(); m_ObjectUpdateQueueLookup.Clear(); } // Handle objects that need re-importing int objReImportCount = m_ObjectReImportQueue.Count; for (int i = 0; i < objReImportCount; i++) { Object obj = m_ObjectReImportQueue[i]; if (obj != null) { //Debug.Log("Re-importing [" + obj.name + "]"); AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(obj)); } } if (objReImportCount > 0) { m_ObjectReImportQueue.Clear(); m_ObjectReImportQueueLookup.Clear(); } // Handle Font Asset Definition Refresh for (int i = 0; i < m_FontAssetDefinitionRefreshQueue.Count; i++) { TMP_FontAsset fontAsset = m_FontAssetDefinitionRefreshQueue[i]; if (fontAsset != null) { fontAsset.ReadFontAssetDefinition(); TMPro_EventManager.ON_FONT_PROPERTY_CHANGED(true, fontAsset); } } if (m_FontAssetDefinitionRefreshQueue.Count > 0) { m_FontAssetDefinitionRefreshQueue.Clear(); m_FontAssetDefinitionRefreshQueueLookup.Clear(); } }
void DoPreRenderUpdates() { // Handle Font Asset Definition Refresh for (int i = 0; i < m_FontAssetDefinitionRefreshQueue.Count; i++) { TMP_FontAsset fontAsset = m_FontAssetDefinitionRefreshQueue[i]; if (fontAsset != null) { fontAsset.ReadFontAssetDefinition(); TMPro_EventManager.ON_FONT_PROPERTY_CHANGED(true, fontAsset); } } if (m_FontAssetDefinitionRefreshQueue.Count > 0) { m_FontAssetDefinitionRefreshQueue.Clear(); m_FontAssetDefinitionRefreshQueueLookup.Clear(); } }