Reimport upgraded TextMesh Pro, modified.

This commit is contained in:
2023-02-01 22:14:43 +08:00
parent 623c53f79a
commit bd256ba1a6
293 changed files with 98622 additions and 345 deletions

View File

@@ -1,21 +1,28 @@
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.TextCore.Text;
using IFont = UnityEngine.Font;
namespace Cryville.Common.Unity.UI {
[RequireComponent(typeof(TextMeshProUGUI))]
public class TMPAutoFont : MonoBehaviour {
public static Shader DefaultShader;
public static readonly List<string> Fonts = new List<string> {
"Arial",
};
static TMP_FontAsset _font;
static FontAsset _font;
TextMeshProUGUI _text;
[SerializeField]
Shader m_shader;
void Awake() {
_text = GetComponent<TextMeshProUGUI>();
if (_font == null) {
var _ifont = new IFont("C:/Windows/Fonts/arial.ttf");
_font = TMP_FontAsset.CreateFontAsset(_ifont);
_font = FontAsset.CreateFontAsset(_ifont);
if (m_shader) _font.material.shader = m_shader;
else if (DefaultShader) _font.material.shader = DefaultShader;
}
_text.font = _font;
}

View File

@@ -4,7 +4,7 @@ MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
executionOrder: -120
icon: {instanceID: 0}
userData:
assetBundleName: