Author Topic: UIPanel will not be rendered in certain situation  (Read 2219 times)

rayark

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
UIPanel will not be rendered in certain situation
« 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.
  • Uncompressed the testbed.zip. There will be a unity project.
  • Open the project. Import NGUI 3.4.9.
  • Open the scene testcase01.unity under the folder TestCase01. Note that be sure to import NGUI before open the scene.
  • Hit play button.

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



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPanel will not be rendered in certain situation
« Reply #1 on: February 11, 2014, 08:26:18 PM »
Interesting... thanks. I will look into this.
« Last Edit: February 11, 2014, 08:31:27 PM by ArenMook »