Initial Commit
This commit is contained in:
parent
53eb92e9af
commit
270ab7d11f
15341 changed files with 700234 additions and 0 deletions
|
@ -0,0 +1,31 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
|
||||
namespace TMPro
|
||||
{
|
||||
public class TMP_PreBuildProcessor : IPreprocessBuildWithReport
|
||||
{
|
||||
public int callbackOrder { get { return 0; } }
|
||||
|
||||
public void OnPreprocessBuild(BuildReport report)
|
||||
{
|
||||
// Find all font assets in the project
|
||||
string searchPattern = "t:TMP_FontAsset";
|
||||
string[] fontAssetGUIDs = AssetDatabase.FindAssets(searchPattern);
|
||||
|
||||
for (int i = 0; i < fontAssetGUIDs.Length; i++)
|
||||
{
|
||||
string fontAssetPath = AssetDatabase.GUIDToAssetPath(fontAssetGUIDs[i]);
|
||||
TMP_FontAsset fontAsset = AssetDatabase.LoadAssetAtPath<TMP_FontAsset>(fontAssetPath);
|
||||
|
||||
if (fontAsset != null && fontAsset.atlasPopulationMode == AtlasPopulationMode.Dynamic && fontAsset.clearDynamicDataOnBuild && fontAsset.atlasTexture.width != 0)
|
||||
{
|
||||
//Debug.Log("Clearing [" + fontAsset.name + "] dynamic font asset data.");
|
||||
fontAsset.ClearFontAssetDataInternal();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue