Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

Trying to animate an Image component material/shader

$
0
0
I have a material with a wipe transition shader. In that shader I have a custom property _blendPos that I use to move the shader effect, like this:

Code (csharp):
  1. my2dSprite.renderer.sharedMaterial.SetFloat("_blendPos", value);
It works fine on a 2D Sprite.

But if i try to assign the same shader/material to an Image component, it doesn't work:

Code (csharp):
  1. // Start()
  2. myImageMaterial = GetComponent<Image>().material;
  3. // Update ()
  4. myImageMaterial.SetFloat("_blendPos",...
Trying to animate an Image component material/shader

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>