Exemple #1
0
 private GachaList.Gacha FindGacha(int gachaId, int gachaIndex, out GACHA_TYPE gacha_type, out GACHA_TYPE real_type, out GachaGuaranteeCampaignInfo guaranteeInfo)
 {
     GachaList.Gacha result = null;
     gacha_type    = (GACHA_TYPE)0;
     real_type     = (GACHA_TYPE)0;
     guaranteeInfo = new GachaGuaranteeCampaignInfo();
     for (int i = 0; i < gachaData.types.Count; i++)
     {
         GachaList.GachaType gachaType = gachaData.types[i];
         for (int j = 0; j < gachaType.groups.Count; j++)
         {
             GachaList.GachaGroup gachaGroup = gachaType.groups[j];
             if (gachaGroup.gachas.Count > gachaIndex)
             {
                 GachaList.Gacha gacha = gachaGroup.gachas[gachaIndex];
                 if (gacha.gachaId == gachaId)
                 {
                     result        = gacha;
                     gacha_type    = gachaType.ViewType;
                     real_type     = gachaType.Type;
                     guaranteeInfo = gachaGroup.gachaGuaranteeCampaignInfo.Find((GachaGuaranteeCampaignInfo info) => info.gachaId == gachaId);
                     if (guaranteeInfo == null)
                     {
                         guaranteeInfo = new GachaGuaranteeCampaignInfo();
                     }
                     return(result);
                 }
             }
         }
     }
     return(result);
 }
Exemple #2
0
    public string CreateButtonBaseName(GachaList.Gacha gacha, GachaGuaranteeCampaignInfo guarantee, bool resultScene = false)
    {
        string text = string.Empty;

        if (!resultScene || (gacha != null && gacha.requiredItemId > 0))
        {
            text = gacha.buttonImg;
        }
        if (guarantee != null && guarantee.IsValid())
        {
            string buttonImageName = guarantee.GetButtonImageName();
            if (buttonImageName != string.Empty)
            {
                text = buttonImageName;
            }
            if (gacha.IsOncePurchase() && guarantee.IsStepUp())
            {
                text = "BTN_GACHA_STEP10_Pay";
            }
            if (guarantee.IsStepUp())
            {
                text = ((!guarantee.hasFreeGachaReward) ? (text + "_" + guarantee.GetImageCount()) : (text + "_FREE"));
            }
        }
        if (resultScene && MonoBehaviourSingleton <GachaManager> .I.gachaResult != null && !string.IsNullOrEmpty(MonoBehaviourSingleton <GachaManager> .I.gachaResult.buttonImg) && string.IsNullOrEmpty(text))
        {
            text = MonoBehaviourSingleton <GachaManager> .I.gachaResult.buttonImg;
        }
        if (string.IsNullOrEmpty(text))
        {
            text = "BTN_GACHA_NORMAL1" + ((gacha.num != 1) ? "0" : string.Empty);
        }
        return(text);
    }
Exemple #3
0
 public void SelectGacha(int gachaId, int gachaIndex)
 {
     selectGacha          = FindGacha(gachaId, gachaIndex, out GACHA_TYPE gacha_type, out GACHA_TYPE real_type, out GachaGuaranteeCampaignInfo guaranteeInfo);
     selectGachaType      = gacha_type;
     selectGachaRealType  = real_type;
     selectGachaGuarantee = guaranteeInfo;
 }
Exemple #4
0
 public void SetSelectGachaGuarantee(GachaGuaranteeCampaignInfo guaranteeInfo)
 {
     selectGachaGuarantee = guaranteeInfo;
 }