Esempio n. 1
0
 public void AddArticleData(Article article)
 {
     article.count++;
     if (articles.Contains(article))
     {
         //更新显示
         for (int i = 0; i < bagGrids.Length; i++)
         {
             if (bagGrids[i].ArticleItem != null)
             {
                 if (bagGrids[i].ArticleItem.Article == article)
                 {
                     bagGrids[i].ArticleItem.SetArticle(article);
                     bagGrids[i].ArticleItem.ScaleMoveToOne(1.2f);
                     break;
                 }
             }
         }
     }
     else
     {
         articles.Add(article);
         //显示
         ArticleItem articleItem = GetArticleItem().GetComponent <ArticleItem>();
         articleItem.SetArticle(article);
         GetBagGrid().SetArticleItem(articleItem);
         articleItem.ScaleMoveToOne(1.2f);
     }
 }
Esempio n. 2
0
    public IEnumerator LoadDataWithAnim()
    {
        HideAllArticleItem();
        yield return(null);

        for (int i = 0; i < articles.Count; i++)
        {
            ArticleItem articleItem = LoadArticleItem(articles[i]);
            GetBagGrid().SetArticleItem(articleItem);
            //修改大小
            articleItem.ScaleMoveToOne(0);
            yield return(new WaitForSeconds(0.1f));
        }
    }