-
-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for TextMeshPro, including
<font>
and <sprite>
…
…tags
- Loading branch information
Showing
22 changed files
with
8,195 additions
and
0 deletions.
There are no files selected for viewing
2,797 changes: 2,797 additions & 0 deletions
2,797
Assets/Demos/TextMeshPro Support/CarterOne-Regular SDF.asset
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Assets/Demos/TextMeshPro Support/CarterOne-Regular SDF.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
22 changes: 22 additions & 0 deletions
22
Assets/Demos/TextMeshPro Support/CarterOne-Regular.ttf.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions
53
Assets/Demos/TextMeshPro Support/Fruit Jelly (B&W).jpg.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#if UNITY_EDITOR | ||
using System.Diagnostics; | ||
using System.Text; | ||
using UnityEditor; | ||
using UnityEngine; | ||
using Debug = UnityEngine.Debug; | ||
|
||
internal static class ImportSample | ||
{ | ||
[MenuItem("Development/Import TMP Support V1", false, 2001)] | ||
private static void ImportTMPSupportV1() | ||
{ | ||
Run("TextMeshPro Support"); | ||
} | ||
|
||
[MenuItem("Development/Import TMP Support V2", false, 2002)] | ||
private static void ImportTMPSupportV2() | ||
{ | ||
Run("TextMeshPro Support (Unity 6)"); | ||
} | ||
|
||
[InitializeOnLoadMethod] | ||
private static void ImportSampleOnLoad() | ||
{ | ||
#if UNITY_2023_2_OR_NEWER | ||
ImportTMPSupportV2(); | ||
#else | ||
ImportTMPSupportV1(); | ||
#endif | ||
} | ||
|
||
private static void Run(string sample) | ||
{ | ||
var p = new Process() | ||
{ | ||
StartInfo = new ProcessStartInfo() | ||
{ | ||
Arguments = $"import-tmp-support.sh '{sample}'", | ||
CreateNoWindow = true, | ||
#if UNITY_EDITOR_WIN | ||
FileName = @"C:\Program Files (x86)\Git\bin\bash.exe", | ||
#else | ||
FileName = "/bin/bash", | ||
#endif | ||
RedirectStandardError = true, | ||
RedirectStandardOutput = true, | ||
WorkingDirectory = $"{Application.dataPath}/..", | ||
UseShellExecute = false | ||
}, | ||
EnableRaisingEvents = true | ||
}; | ||
|
||
p.Exited += (_, __) => | ||
{ | ||
var result = new StringBuilder(); | ||
var stdout = p.StandardOutput.ReadToEnd(); | ||
result.Append("stdout: "); | ||
result.Append(stdout); | ||
result.AppendLine(); | ||
result.Append("stderr: "); | ||
result.Append(p.StandardError.ReadToEnd()); | ||
Debug.Log(result); | ||
|
||
if (p.ExitCode == 0 && stdout.StartsWith("Imported: ")) | ||
{ | ||
var path = stdout.Replace("Imported: ", "").Trim(); | ||
AssetDatabase.ImportAsset(path, ImportAssetOptions.ImportRecursive); | ||
} | ||
}; | ||
|
||
p.Start(); | ||
} | ||
} | ||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.