/// <summary>
        /// 根据索引查找对应组件
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public object GetLuaComs(int index)
        {
            LuaCom com = m_LuaComs[index];

            switch (com.Type)
            {
            case LuaComponentType.GameObject:
                return(com.Trans.gameObject);

            case LuaComponentType.Transform:
                return(com.Trans);

            case LuaComponentType.Button:
                return(com.Trans.GetComponent <Button>());

            case LuaComponentType.Image:
                return(com.Trans.GetComponent <Image>());

            case LuaComponentType.YouYouImage:
                return(com.Trans.GetComponent <YouYouImage>());

            case LuaComponentType.Text:
                return(com.Trans.GetComponent <Text>());

            case LuaComponentType.YouYouText:
                return(com.Trans.GetComponent <YouYouText>());

            case LuaComponentType.RawImage:
                return(com.Trans.GetComponent <RawImage>());

            case LuaComponentType.InputField:
                return(com.Trans.GetComponent <InputField>());

            case LuaComponentType.Scrollbar:
                return(com.Trans.GetComponent <Scrollbar>());

            case LuaComponentType.ScrollView:
                return(com.Trans.GetComponent <ScrollRect>());

            case LuaComponentType.MultiScroller:
                return(com.Trans.GetComponent <UIMultiScroller>());
            }
            return(com.Trans);
        }
        protected override void OnBeforeDestroy()
        {
            base.OnBeforeDestroy();
            if (onBeforeDestroy != null)
            {
                onBeforeDestroy();
            }
            onInit          = null;
            onOpen          = null;
            onClose         = null;
            onBeforeDestroy = null;

            //卸载图片资源
            int len = m_LuaComs.Length;

            for (int i = 0; i < len; i++)
            {
                LuaCom com = m_LuaComs[i];

                switch (com.Type)
                {
                case LuaComponentType.Button:
                case LuaComponentType.Image:
                case LuaComponentType.YouYouImage:
                {
                    Image ima = com.Trans.GetComponent <Image>();
                    ima.sprite = null;
                }
                break;

                case LuaComponentType.RawImage:
                {
                    RawImage ima = com.Trans.GetComponent <RawImage>();
                    ima.texture = null;
                }
                break;
                }
                com.Trans = null;
                com       = null;
            }
        }