public override bool Load()
        {
            GachaTop targetData = target as GachaTop;

            var    client = new DatabaseClient("", "");
            string error  = string.Empty;
            var    db     = client.GetDatabase(targetData.SheetName, ref error);
            var    table  = db.GetTable <GachaTopData>(targetData.WorksheetName) ?? db.CreateTable <GachaTopData>(targetData.WorksheetName);

            List <GachaTopData> myDataList = new List <GachaTopData>();

            var all = table.FindAll();

            foreach (var elem in all)
            {
                GachaTopData data = new GachaTopData();

                data = Cloner.DeepCopy <GachaTopData>(elem.Element);
                myDataList.Add(data);
            }

            targetData.dataArray = myDataList.ToArray();

            EditorUtility.SetDirty(targetData);
            AssetDatabase.SaveAssets();

            return(true);
        }
示例#2
0
    void OnClick(MasterData.GachaTopData data)
    {
        Reset();

        gameObject.SetActive(false);
        GachaManager.OpenGachaItemList(data);
    }
示例#3
0
    public static void OpenGachaItemList(MasterData.GachaTopData data)
    {
        if (isInstance)
        {
            List <MasterData.GachaItemData> itemDataList = new List <MasterData.GachaItemData>();

            var gachaItemData = MasterDataManager.GetMasterData <MasterData.GachaItem>(MasterDataManager.MASTER_DATE_ID.GACHA_ITEM);
            foreach (var itemData in gachaItemData.dataArray)
            {
                if (itemData.Topid == data.ID)
                {
                    itemDataList.Add(itemData);
                }
            }

            var dataArray = itemDataList.ToArray();
            instance.gachaItem.Open(dataArray);
        }
    }