UnityEngine.MaterialPropertyBlock.SetTexture C# (CSharp) Method

SetTexture() public method

Set a texture property.

public SetTexture ( string name, Texture value ) : void
name string The name of the property.
value Texture The Texture to set.
return void
        public void SetTexture(string name, Texture value)
        {
            this.SetTexture(Shader.PropertyToID(name), value);
        }

Same methods

MaterialPropertyBlock::SetTexture ( int nameID, Texture value ) : void

Usage Example

コード例 #1
0
 public void UpdatePropertyBlock()
 {
     MaterialPropertyBlock propBlock = new MaterialPropertyBlock();
     render.GetPropertyBlock(propBlock);
     propBlock.SetTexture("_MainTex", maskSprite.texture);
     propBlock.SetTexture("_SprTex", springSprite);
     propBlock.SetTexture("_SumTex", summerSprite);
     propBlock.SetTexture("_AutTex", autumnSprite);
     propBlock.SetTexture("_WinTex", winterSprite);
     render.SetPropertyBlock(propBlock);
 }
All Usage Examples Of UnityEngine.MaterialPropertyBlock::SetTexture