MaterialPropertyBlockInterfaceExtensions Class Reference

Static extension class that provides useful functions on things that can be done through MaterialPropertyBlockInterfaces.

Static Public Member Functions

static Color GetColor (this IGraphicsMaterialPropertyBlockInterface blockInterfaceGetColorFrom)
 Gets the MaterialProperty block of the blockInterfaceToGetTextureFrom, then extracts and returns the main color value from it.
 
static Color GetColor (this IGraphicsMultiMaterialPropertyBlockInterface blockInterfaceGetColorFrom, int matIndex)
 Extension function for IGraphicsMultiMaterialPropertyBlockInterface's. Gets the MaterialPropertyBlock of the blockInterfaceToSet based on the index number provided, then gets the color specified by the MaterialPropertyBlock and returns it.

 
static Texture GetMainTexture (this IGraphicsMaterialPropertyBlockInterface blockInterfaceToGetTextureFrom)
 Gets the MaterialProperty block of the blockInterfaceToGetTextureFrom, then extracts and returns the main texture reference from it.
 
static Texture GetMainTexture (this IGraphicsMultiMaterialPropertyBlockInterface blockInterfaceGetTextureFrom, int matIndex)
 Extension function for IGraphicsMultiMaterialPropertyBlockInterface's. Gets the MaterialPropertyBlock of the blockInterfaceToSet based on the index number provided. Then assigns the texture provided, to the MaterialPropertyBlock. Then sets the MaterialPropertyBlock back to blockInterfaceToSet.
 
static void SetColor (this IGraphicsMaterialPropertyBlockInterface blockInterfaceToSet, Color color)
 Gets the blockInterfaceToSet's MaterialPropertyBlock. Then assigns to it the specified color. Then assigns the modified MaterialPropertyBlock back to the blockInterfaceToSet.
 
static void SetColor (this IGraphicsMultiMaterialPropertyBlockInterface blockInterfaceToSet, int matIndex, Color color)
 Extension function for IGraphicsMultiMaterialPropertyBlockInterface's. Sets the MaterialPropertyBlock of the blockInterfaceToSet based on the index number provided, then assigns the color provided, to the MaterialPropertyBlock.

 
static void SetMainTexture (this IGraphicsMaterialPropertyBlockInterface blockInterfaceToSet, Texture tex)
 Extension function for IGraphicsMultiMaterialPropertyBlockInterface's. Gets the MaterialPropertyBlock of the blockInterfaceToSet provided. Then assigns the texture provided, to the MaterialPropertyBlock. Then sets the MaterialPropertyBlock back to blockInterfaceToSet.
 
static void SetMainTexture (this IGraphicsMultiMaterialPropertyBlockInterface blockInterfaceToSet, int matIndex, Texture tex)
 Extension function for IGraphicsMultiMaterialPropertyBlockInterface's. Gets the MaterialPropertyBlock of the blockInterfaceToSet based on the index number provided. Then assigns the texture provided, to the MaterialPropertyBlock. Then sets the MaterialPropertyBlock back to blockInterfaceToSet.
 

Static Public Attributes

static int defaultColorID
 Initialized at first use of MaterialPropertyBlockInterfaceExtensions, to store the colorId for "_Color".
 
static string defaultColorString
 The default main color string- hard coded initialization.
 
static int defaultTextureID
 Initialized at first use of MaterialPropertyBlockInterfaceExtensions, to store the textureID for "_MainTex".
 
static string mainTextureString
 The default main texture string- hard coded initialization.
 
static bool neverRunMaterialChecks
 Experimental optimization, not recommended to change. When set to true, the various GetX and SetX extension functions in this class, will NOT check the hasX function before attempting to touch the value.