protected override void Awake()
    {
        if (base.gameObject.name.EndsWith("(Clone)"))
        {
            base.gameObject.name = base.gameObject.name.Substring(0, base.gameObject.name.Length - 7);
        }
        this.startPos = base.transform.localPosition;
        base.Awake();
        IEnumerator enumerator = base.transform.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object    obj = enumerator.Current;
                Transform tm  = (Transform)obj;
                this.SearchChild(tm);
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
        if (this.touchPanels.Count == 0)
        {
            base.onTouchEnded += delegate(Touch touch, Vector2 pos, bool flag)
            {
                if (flag && !this.permanentMode)
                {
                    this.returnVal = 0;
                    this.ClosePanel(true);
                }
            };
        }
        this.touchBehavior = GUICollider.TouchBehavior.None;
        GUIManager.AddCommonDialog(this);
    }