Reimport upgraded TextMesh Pro, modified.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
executionOrder: -120
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
@@ -3,6 +3,7 @@ using Cryville.Audio.Source;
|
||||
using Cryville.Common;
|
||||
using Cryville.Common.Unity;
|
||||
using Cryville.Common.Unity.Input;
|
||||
using Cryville.Common.Unity.UI;
|
||||
using FFmpeg.AutoGen;
|
||||
using Ionic.Zip;
|
||||
using Newtonsoft.Json;
|
||||
@@ -127,6 +128,8 @@ namespace Cryville.Crtr {
|
||||
Settings.Default.LastRunVersion = Application.version;
|
||||
Settings.Default.Save();
|
||||
|
||||
TMPAutoFont.DefaultShader = Resources.Load<Shader>("TextMesh Pro/Shaders/TMP_SDF SSD");
|
||||
|
||||
Logger.Log("main", 1, "Game", "Initialized");
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
"GUID:d8ea0e0da3ad53a45b65c912ffcacab0",
|
||||
"GUID:5686e5ee69d0e084c843d61c240d7fdb",
|
||||
"GUID:2922aa74af3b2854e81b8a8b286d8206",
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f"
|
||||
"GUID:da293eebbcb9a4947a212534c52d1a32"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
Reference in New Issue
Block a user