Skip to content

Commit

Permalink
👌 Little Update
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenKrahforst committed May 5, 2024
1 parent f575cef commit be0f1e2
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions BetterBeatSaber/Extensions/TextMeshProExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,41 +45,4 @@ public static void SetBloom(this TextMeshPro text, bool enable = true) {
text.font = enable ? BloomFont ?? BeatSaberUI.MainTextFont : BeatSaberUI.MainTextFont;
}

public static TMP_FontAsset Clone(this TMP_FontAsset original) {

#if PRE_130
return TMP_FontAsset.CreateFontAsset(original.sourceFontFile);
#else

if (original.atlasPopulationMode == AtlasPopulationMode.Dynamic && original.sourceFontFile != null)
return TMP_FontAsset.CreateFontAsset(original.sourceFontFile);

var instance = ScriptableObject.CreateInstance<TMP_FontAsset>();

instance.SetField("m_Version", original.version);
instance.SetField("m_FaceInfo", original.faceInfo);

instance.atlasPopulationMode = original.atlasPopulationMode;
instance.atlas = original.atlas;
instance.atlasTextures = original.atlasTextures;

instance.SetField("m_AtlasWidth", original.atlasWidth);
instance.SetField("m_AtlasHeight", original.atlasHeight);
instance.SetField("m_AtlasPadding", original.atlasPadding);
instance.SetField("m_AtlasRenderMode", original.atlasRenderMode);

#if !PRE_130
instance.isMultiAtlasTexturesEnabled = original.isMultiAtlasTexturesEnabled;
#endif

instance.material = new Material(original.material);

instance.ReadFontAssetDefinition();

return instance;

#endif

}

}

0 comments on commit be0f1e2

Please sign in to comment.