mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
use precomputed shader ID
This commit is contained in:
1 parent
d1116b3fce
commit
9ec270bd68
2 files changed
+6
-2
No files matched your search
@@ -46,8 +46,8 @@ public static class Extensions
|
||||
/// <param name="text">The TMP text.</param>
|
||||
public static void EnableStencilMasking(this TMP_Text text)
|
||||
{
|
||||
text.fontMaterial.SetFloat(ShaderID.Get("_Stencil"), 1);
|
||||
text.fontMaterial.SetFloat(ShaderID.Get("_StencilComp"), 4);
|
||||
text.fontMaterial.SetFloat(ShaderID.Stencil, 1);
|
||||
text.fontMaterial.SetFloat(ShaderID.StencilComp, 4);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace MiraAPI.Utilities;
|
||||
|
||||
/// <summary>
|
||||
/// Utility class for caching shader property IDs.
|
||||
/// </summary>
|
||||
public static class ShaderID
|
||||
{
|
||||
private static readonly Dictionary<string, int> Cache = [];
|
||||
|
||||
Reference in new issue
Block a user