Пример #1
0
        //リソースを読み込んで、データを作成・更新
        void OnApply()
        {
            Debug.Log("Rebuilding...", this);
            categories.Clear();
            int count = dataList.List.Count;

            for (int i = 0; i < count; ++i)
            {
                AvatorFolderData data     = dataList.List[i];
                Category         category = new Category();
                category.SortOrder = i;
                category.Name      = data.folder.name;
                category.Tag       = data.tag;
                category.Sprites   = data.GetAllAssets <Sprite>();
                foreach (Sprite asset in category.Sprites)
                {
                    Debug.Log("" + asset.name);
                }
                categories.Add(category);
            }
            categories.Sort((a, b) => a.SortOrder - b.SortOrder);
            RebuildSize();
            //プレビュー用のパターンデータも作り直し
            previewPattern.Rebuild(this);
        }
Пример #2
0
 void UpdateFunction()
 {
     if (hasApply)
     {
         Debug.Log("Rebuilding...", this);
         categories.Clear();
         int count = dataList.List.Count;
         for (int i = 0; i < count; ++i)
         {
             AvatorFolderData data     = dataList.List[i];
             Category         category = new Category();
             category.SortOrder = i;
             category.Name      = data.folder.name;
             category.Tag       = data.tag;
             category.Sprites   = data.GetAllAssets <Sprite>();
             categories.Add(category);
         }
         categories.Sort((a, b) => a.SortOrder - b.SortOrder);
         RebuildSize();
         //プレビュー用のパターンデータも作り直し
         previewPattern.RebuildOnApply(this);
     }
     if (hasReimport)
     {
         dataList.ReimportResources("Tag" + this.name);
     }
     hasApply    = false;
     hasReimport = false;
 }