Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity UI Bug with changing sprites by script шт 2019.1.0f1

Discussion in 'UGUI & TextMesh Pro' started by LastChaos, Apr 19, 2019.

  1. LastChaos

    LastChaos

    Joined:
    Dec 9, 2013
    Posts:
    39
    Hi. When replacing sprites with a script, their correlation is broken. See screenshots:

    1. Start
    Screenshot_2.png

    2. First click "Replace"
    Screenshot_3.png

    3. Second click "Replace"
    Screenshot_4.png
    As you can see, the ratio of sprites is broken.

    4. Third click "Replace"
    Screenshot_3.png

    5. Fourth click "Replace"
    Screenshot_4.png
    And so on...

    This problem is observed in 2019.1, in previous versions it is not.

    Script I used:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3.  
    4. public class TestSprites : MonoBehaviour
    5. {
    6.     public Image image0;
    7.     public Image image1;
    8.  
    9.     public void Replace()
    10.     {
    11.         Sprite sprite = image0.sprite;
    12.         image0.sprite = image1.sprite;
    13.         image1.sprite = sprite;
    14.     }
    15. }
    Is there a rational solution to this problem, or is it worth waiting for an update?
     
    Last edited: Apr 19, 2019
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,438
    Please submit this example via bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post the Case number (number only, not the link) in this forum thread for Unity staff to pick up.
     
  3. Riddik

    Riddik

    Joined:
    Jun 16, 2017
    Posts:
    20
    I've the same issue after updating to 2019.1.0

    And "SetNativeSize()" no longer works
     
  4. LastChaos

    LastChaos

    Joined:
    Dec 9, 2013
    Posts:
    39
    Done. Case 1147466
     
    Peter77 likes this.
  5. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    583
  6. POY1

    POY1

    Joined:
    Jun 27, 2018
    Posts:
    3
    Found the same issue (2019.1.0f2) but these months i've been using betas 2019.1.0b4, 2019.2.0a9 and 2019.2.0a7 and the bug is happening there also. Im using Android platform.
     
  7. LastChaos

    LastChaos

    Joined:
    Dec 9, 2013
    Posts:
    39
    2019.1.1f1 - still not fixed
     
  8. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Hope this get fixed soon! :rolleyes:
     
  9. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Unity 2019.1.2f1 also not fixed :(
     
  10. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    @LastChaos this comment is off topic, I was trying to contact you through conversation but that's not allowed in your case, I guess. Can you please PM me back? I just want to ask you something important.