forked from YARC-Official/YARG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace YargTrace with a much more proper logging system (YARC-Offici…
…al#722) * Remove ZString from UPM, add Nuget version and copy Unity extensions to plugins folder * Write to internal unity logger * Setup LogHandler * Overwrite internal unity fields with custom logger * Load PathHelper before Unity splash * Specify log type in call to native Unity Internal_Log * Overwrite and restore Unity internal logging on Play Enter/Exit * Write to custom log file * Update YARG.Core for logging changes * Remove LogItem Format * Change a lot of Debug.Log calls to YargLogger (not done) * Update YARG.Core * Set minimum log level to Debug in editor * Rework LogItem to allow proper/generic pooling of log items * Update more logging calls * Changed all logging to YargLogger * Update YARG.Core * Add link to unity console log formatter * Update YARG.Core * Couple logging updates for parity with Core * Get rid of null LogItem argument * Update YARG.Core * Debug call to YargLogger in ScoreScreenMenu * Missing semicolon lol --------- Co-authored-by: RileyTheFox <[email protected]>
- Loading branch information
1 parent
361dd2e
commit b3193b1
Showing
80 changed files
with
1,053 additions
and
507 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
Assets/Plugins/ZString-Ext/Unity/TextMeshProExtensions.SetStringBuilder.cs
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,16 @@ | ||
#if ZSTRING_TEXTMESHPRO_SUPPORT | ||
using System; | ||
using TMPro; | ||
|
||
namespace Cysharp.Text | ||
{ | ||
public static partial class TextMeshProExtensions | ||
{ | ||
public static void SetText(this TMP_Text text, Utf16ValueStringBuilder stringBuilder) | ||
{ | ||
var array = stringBuilder.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
} | ||
#endif |
2 changes: 1 addition & 1 deletion
2
Assets/Script/Helpers/EditorDebug.cs.meta → ...eshProExtensions.SetStringBuilder.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
197 changes: 197 additions & 0 deletions
197
Assets/Plugins/ZString-Ext/Unity/TextMeshProExtensions.cs
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,197 @@ | ||
#if ZSTRING_TEXTMESHPRO_SUPPORT | ||
using System; | ||
using TMPro; | ||
|
||
namespace Cysharp.Text | ||
{ | ||
public static partial class TextMeshProExtensions | ||
{ | ||
public static void SetText<T>(this TMP_Text text, T arg0) | ||
{ | ||
using ( var sb = new Cysharp.Text.Utf16ValueStringBuilder( true ) ) | ||
{ | ||
sb.Append(arg0); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0>(this TMP_Text text, string format, T0 arg0) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1>(this TMP_Text text, string format, T0 arg0, T1 arg1) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7, T8>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
public static void SetTextFormat<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this TMP_Text text, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15) | ||
{ | ||
using (var sb = new Cysharp.Text.Utf16ValueStringBuilder(true)) | ||
{ | ||
|
||
sb.AppendFormat(format, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); | ||
var array = sb.AsArraySegment(); | ||
text.SetCharArray(array.Array, array.Offset, array.Count); | ||
} | ||
} | ||
|
||
} | ||
} | ||
#endif |
2 changes: 1 addition & 1 deletion
2
...Persistent/YargUnityTraceListener.cs.meta → ...g-Ext/Unity/TextMeshProExtensions.cs.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,22 @@ | ||
{ | ||
"name": "ZString-Ext", | ||
"rootNamespace": "", | ||
"references": [ | ||
"Unity.TextMeshPro" | ||
], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": true, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [ | ||
{ | ||
"name": "com.unity.textmeshpro", | ||
"expression": "", | ||
"define": "ZSTRING_TEXTMESHPRO_SUPPORT" | ||
} | ||
], | ||
"noEngineReferences": false | ||
} |
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.