Class MaterialReferenceManager
Inheritance
System.Object
MaterialReferenceManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: TMPro
Syntax
public class MaterialReferenceManager
Properties
instance
Get a singleton instance of the registry
Declaration
public static MaterialReferenceManager instance { get; }
Property Value
Type | Description |
---|---|
MaterialReferenceManager |
Methods
AddColorGradientPreset(Int32, TMP_ColorGradient)
Add new Color Gradient Preset to dictionary.
Declaration
public static void AddColorGradientPreset(int hashCode, TMP_ColorGradient spriteAsset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hashCode | |
TMP_ColorGradient | spriteAsset |
AddFontAsset(TMP_FontAsset)
Add new font asset reference to dictionary.
Declaration
public static void AddFontAsset(TMP_FontAsset fontAsset)
Parameters
Type | Name | Description |
---|---|---|
TMP_FontAsset | fontAsset |
AddFontMaterial(Int32, Material)
Add new Material reference to dictionary.
Declaration
public static void AddFontMaterial(int hashCode, Material material)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hashCode | |
Material | material |
AddSpriteAsset(Int32, TMP_SpriteAsset)
Add new Sprite Asset to dictionary.
Declaration
public static void AddSpriteAsset(int hashCode, TMP_SpriteAsset spriteAsset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hashCode | |
TMP_SpriteAsset | spriteAsset |
AddSpriteAsset(TMP_SpriteAsset)
Add new Sprite Asset to dictionary.
Declaration
public static void AddSpriteAsset(TMP_SpriteAsset spriteAsset)
Parameters
Type | Name | Description |
---|---|---|
TMP_SpriteAsset | spriteAsset |
Contains(TMP_FontAsset)
Function to check if the font asset is already referenced.
Declaration
public bool Contains(TMP_FontAsset font)
Parameters
Type | Name | Description |
---|---|---|
TMP_FontAsset | font |
Returns
Type | Description |
---|---|
System.Boolean |
Contains(TMP_SpriteAsset)
Function to check if the sprite asset is already referenced.
Declaration
public bool Contains(TMP_SpriteAsset sprite)
Parameters
Type | Name | Description |
---|---|---|
TMP_SpriteAsset | sprite |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetColorGradientPreset(Int32, out TMP_ColorGradient)
Function returning the Color Gradient Preset corresponding to the provided hash code.
Declaration
public static bool TryGetColorGradientPreset(int hashCode, out TMP_ColorGradient gradientPreset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hashCode | |
TMP_ColorGradient | gradientPreset |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetFontAsset(Int32, out TMP_FontAsset)
Function returning the Font Asset corresponding to the provided hash code.
Declaration
public static bool TryGetFontAsset(int hashCode, out TMP_FontAsset fontAsset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hashCode | |
TMP_FontAsset | fontAsset |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetMaterial(Int32, out Material)
Function returning the Font Material corresponding to the provided hash code.
Declaration
public static bool TryGetMaterial(int hashCode, out Material material)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hashCode | |
Material | material |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetSpriteAsset(Int32, out TMP_SpriteAsset)
Function returning the Sprite Asset corresponding to the provided hash code.
Declaration
public static bool TryGetSpriteAsset(int hashCode, out TMP_SpriteAsset spriteAsset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hashCode | |
TMP_SpriteAsset | spriteAsset |
Returns
Type | Description |
---|---|
System.Boolean |