Change the UI image using script in unity c#

后端 未结 4 530
走了就别回头了
走了就别回头了 2021-01-24 04:58

I want to change the UI image in random order. I have a gameobject in UI(canvas) containing Image component and it has nul

4条回答
  •  野的像风
    2021-01-24 05:30

    Use overrideSprite field instead of sprite - documentation

    Unfortunately, unity ui is full of such pitfalls and it's api is totally counter-intuitive, so you have to be careful and check the docs regularly

提交回复
热议问题