Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: rayark on February 11, 2014, 01:39:20 AM

Title: UIPanel will not be rendered in certain situation
Post by: rayark on February 11, 2014, 01:39:20 AM
Hi,

I've attach a Testbed project.
It shows a case that UIPanel will not be rendered even if its alpha is set to 1.0.

This issue can be reproduced by the following procedure.

Due to the script TestCase01.cs attached to UI Root,
the label should hide after playing, and it will show after 0.5 sec.
However, after 0.5 sec, even though the GameObject "Panel" is active and its UIPanel.alpha is set to 1.0,
the UIPanel is still not be rendered.

I also attach a video clip to demonstrate.

The following is the script TestCase01.cs.
  1. public class TestCase01 : MonoBehaviour {
  2.        
  3.         [SerializeField]
  4.         GameObject _parent; // parent GameObject of target's GameObject
  5.         [SerializeField]
  6.         UIRect _target;
  7.        
  8.         void Start(){
  9.                 StartCoroutine(_Process());
  10.         }
  11.        
  12.         IEnumerator _Process(){
  13.  
  14.                 yield return null;
  15.  
  16.                 _target.alpha = 0.0f;
  17.  
  18.                 yield return null;
  19.  
  20.                 _parent.SetActive(false);
  21.  
  22.                 yield return new WaitForSeconds(0.5f);
  23.  
  24.                 _parent.SetActive(true);
  25.                 _target.alpha = 1.0f;
  26.  
  27.                 yield break;
  28.         }
  29. }
  30.  

Alvin


Title: Re: UIPanel will not be rendered in certain situation
Post by: ArenMook on February 11, 2014, 08:26:18 PM
Interesting... thanks. I will look into this.