Example #1
0
        PreviewItem AddGUID(string guid, int index)
        {
            GameObject go = UIEditorHelper.GUIDToObject <GameObject>(guid);

            if (go != null)
            {
                PreviewItem ent = new PreviewItem();
                ent.prefab = go;
                ent.guid   = guid;
                GeneratePreview(ent, false);
                if (index < mItems.size)
                {
                    if (!IsInList(mItems, ent))
                    {
                        mItems.Insert(index, ent);
                    }
                }
                else
                {
                    if (!IsInList(mItems, ent))
                    {
                        mItems.Add(ent);
                    }
                }
                return(ent);
            }
            return(null);
        }