Ejemplo n.º 1
0
    public void CreateFertilizerList()
    {
        ClearList();
        List <WPData_Fertilizer> fertilizerData = WPGameDataManager.instance.GetData <WPData_Fertilizer>(WPEnum.GameData.eFertilizer);

        for (int index = 0; index < fertilizerData.Count; ++index)
        {
            WPScrollViewItem_Book newItem = Instantiate(ui_Book).AddComponent <WPScrollViewItem_Book>();
            newItem.SetName(index.ToString());
            newItem.SetSprite(fertilizerSpriteData[index]);
            newItem.AddEvent(delegate { OnClick_Fertilizer(System.Convert.ToInt32(newItem.name)); });
            AddItem(newItem);
        }
        SortItemToItem();
    }
Ejemplo n.º 2
0
    public void CreateSeedList()
    {
        ClearList();
        List <WPData_Seed> seedData = WPGameDataManager.instance.GetData <WPData_Seed>(WPEnum.GameData.eSeed);

        for (int index = 0; index < seedData.Count; ++index)
        {
            WPScrollViewItem_Book newItem = Instantiate(ui_Book).AddComponent <WPScrollViewItem_Book>();
            newItem.SetName(index.ToString());
            if (WPUserDataManager.instance.Level >= seedData[index].UnlockLevel)
            {
                newItem.SetSprite(seedSpriteData[index]);
                newItem.AddEvent(delegate { OnClick_Seed(System.Convert.ToInt32(newItem.name)); });
            }
            else
            {
                newItem.SetSprite(lockSprite);
            }
            AddItem(newItem);
        }
        SortItemToItem();
    }