Beispiel #1
0
 private void OnSelect(bool isSelected)
 {
     if (!isSelected && (this.mChild != null))
     {
         this.mLabelList.Clear();
         this.handleEvents = false;
         if (this.isAnimated)
         {
             UIWidget[] componentsInChildren = this.mChild.GetComponentsInChildren <UIWidget>();
             int        index  = 0;
             int        length = componentsInChildren.Length;
             while (index < length)
             {
                 UIWidget widget = componentsInChildren[index];
                 Color    color  = widget.color;
                 color.a = 0f;
                 TweenColor.Begin(widget.gameObject, 0.15f, color).method = UITweener.Method.EaseOut;
                 index++;
             }
             NGUITools.SetAllowClickChildren(this.mChild, false);
             UpdateManager.AddDestroy(this.mChild, 0.15f);
         }
         else
         {
             UnityEngine.Object.Destroy(this.mChild);
         }
         this.mBackground = null;
         this.mHighlight  = null;
         this.mChild      = null;
     }
 }
Beispiel #2
0
    /// <summary>
    /// Get rid of the popup dialog when the selection gets lost.
    /// </summary>

    void OnSelect(bool isSelected)
    {
        if (!isSelected && mChild != null)
        {
            mLabelList.Clear();
            handleEvents = false;

            if (isAnimated)
            {
                UIWidget[] widgets = mChild.GetComponentsInChildren <UIWidget>(true);

                foreach (UIWidget w in widgets)
                {
                    Color c = w.color;
                    c.a = 0f;
                    TweenColor.Begin(w.gameObject, animSpeed, c).method = UITweener.Method.EaseOut;
                }

                Collider[] cols = mChild.GetComponentsInChildren <Collider>(true);
                foreach (Collider col in cols)
                {
                    col.enabled = false;
                }
                UpdateManager.AddDestroy(mChild, animSpeed);
            }
            else
            {
                Destroy(mChild);
            }
            mChild = null;
        }
    }
Beispiel #3
0
    /// <summary>
    /// Get rid of the popup dialog when the selection gets lost.
    /// </summary>

    void OnSelect(bool isSelected)
    {
        if (!isSelected && mChild != null)
        {
            mLabelList.Clear();
            handleEvents = false;

            if (isAnimated)
            {
                UIWidget[] widgets = mChild.GetComponentsInChildren <UIWidget>();

                for (int i = 0, imax = widgets.Length; i < imax; ++i)
                {
                    UIWidget w = widgets[i];
                    Color    c = w.color;
                    c.a = 0f;
                    TweenColor.Begin(w.gameObject, animSpeed, c).method = UITweener.Method.EaseOut;
                }

                Collider[] cols = mChild.GetComponentsInChildren <Collider>();
                for (int i = 0, imax = cols.Length; i < imax; ++i)
                {
                    cols[i].enabled = false;
                }
                UpdateManager.AddDestroy(mChild, animSpeed);
            }
            else
            {
                Destroy(mChild);
            }

            mBackground = null;
            mHighlight  = null;
            mChild      = null;
        }
    }