Ejemplo n.º 1
0
    public static GetRewardPopup CreatePopup(GetRewardPopupInitData data)
    {
        var popup = GenericPrefab.Instantiate <GetRewardPopup>();

        popup.Initialize(data);
        return(popup);
    }
Ejemplo n.º 2
0
    private void Initialize(GetRewardPopupInitData data)
    {
        this.data = data;
        rewardSlotGird ??= new RewardSlot.Grid(CreateRewardSlot, DestroyRewardSlot);

        var rewardDataList = data.CCGAssetList.ConvertAll <RewardData>(d => new RewardData()
        {
            CardSO = data.CardListSO.List.FirstOrDefault(so => so.CardId == d.Id)
        });

        rewardSlotGird.ApplyList(rewardDataList);
    }