private int AddNewFrame(UIController uc)
        {
            Object[] selection = (Object[])Selection.objects;
            if (selection.Length == 0)
            {
                return(-1);
            }
            Dictionary <string, UIFrameItem> _liEditUse = ArrayConverseToList(uc._frameItems);
            string strFrameId = "";

            foreach (Object obj in selection)
            {
                UIFrameItem ufi = new UIFrameItem();
                GameObject  go  = (GameObject)obj;
                strFrameId = "ID_" + go.name;
                if (_liEditUse.ContainsKey(strFrameId))
                {
                    continue;
                }

                UIFrame uf = go.GetComponent <UIFrame>();
                if (uf == null)
                {
                    Debug.LogError("<color=red>[Error]</color>---" + obj + "上没有UIFrame组件!!", obj);
                    continue;
                }
                ufi._prefabFrame  = uf;
                uf.FrameId        = strFrameId;
                ufi._strFrameID   = uf.FrameId;
                ufi._nPannelIndex = 1;
                _liEditUse.Add(strFrameId, ufi);
            }
            uc._frameItems = ListConverseToArray(_liEditUse);
            return(_liEditUse.Count - 1);
        }
        private UIFrameItem[] ListConverseToArray(Dictionary <string, UIFrameItem> li)
        {
            UIFrameItem[] ufiarray = new UIFrameItem[li.Count];
            var           tor      = li.Values.GetEnumerator();
            int           nIndex   = 0;

            while (tor.MoveNext())
            {
                ufiarray[nIndex++] = tor.Current;
            }
            return(ufiarray);
        }