| | |
| | | PetInfoConfig petInfoConfig;
|
| | | bool isAutoTrain = false;
|
| | | List<GameObject> Skillimage = new List<GameObject>();
|
| | | private bool IsZidong = false;
|
| | | private void OnEnable()
|
| | | {
|
| | | IsZidong = false;
|
| | | timePlay = 0;
|
| | | Skillimage.Clear();
|
| | | Skillimage.Add(Skillimage1);
|
| | |
| | | {
|
| | | if (petmodel._DicPetBack.ContainsKey(petInfoConfig.ID))
|
| | | {
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1);
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1,0);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId);
|
| | | }
|
| | |
|
| | |
|
| | | // petTrainBtn.RemoveAllListeners();
|
| | | }
|
| | |
|
| | | private void ClickPetAutoTrainBtn()
|
| | |
| | | int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, petmodel.petUpgradeToolId);
|
| | | if (haveCnt < costNum)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId);
|
| | | if (!isAutoTrain)
|
| | | {
|
| | | WindowCenter.Instance.Open<AutoTrainTipsPWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | AutoTrainTipsPWin.IsFairy = false;
|
| | | isAutoTrain = false;
|
| | | IsZidong = false;
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
|
| | | StopCoroutine("FairyJadeD");
|
| | |
|
| | | }
|
| | | |
| | | return;
|
| | | }
|
| | | isAutoTrain = !isAutoTrain;
|
| | |
| | | if (petmodel.Wait)
|
| | | {
|
| | | petmodel.Wait = false;
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum);
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum,0);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | if (petmodel.Wait)
|
| | | {
|
| | | petmodel.Wait = false;
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt);
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt,0);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
|
| | | isAutoTrain = false;
|
| | |
|
| | | if (!IsZidong)
|
| | | {
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
|
| | | isAutoTrain = false;
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | #endregion
|
| | |
| | | ridingModel.property = PropertyTip.Pet;
|
| | | ridingModel.RidingId = PetID;
|
| | | WindowCenter.Instance.Open<TargetPetAttrWin>();
|
| | | // WindowCenter.Instance.Get<TargetPetAttrWin>().PropertyMountAndPet(PropertyTip.Pet, PetID);
|
| | |
|
| | | });
|
| | | if (petmodel._DicPetBack[PetID].PetClass >= PetModel.MaxRank)//满阶
|
| | | {
|
| | |
| | | FragmentUnlockTip.SetActive(false);
|
| | | FullAttTip.SetActive(true);
|
| | | }
|
| | |
|
| | | public void FairyJadeDomesticate()//仙玉驯养
|
| | | {
|
| | | int NumberLv = AutoTrainTipsPWin._Lvnumber;//等级所需的等级
|
| | | if (NumberLv > petmodel._DicPetBack[typePetID].PetClass && !WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>() && AutoTrainTipsPWin.IsFairy)
|
| | | {
|
| | | isAutoTrain = true;
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7");
|
| | | IsZidong = true;
|
| | | StartCoroutine("FairyJadeD");
|
| | | }
|
| | | }
|
| | | IEnumerator FairyJadeD()//仙玉驯养
|
| | | {
|
| | | int number = AutoTrainTipsPWin.DomesticateNumber;//所需的颗数
|
| | | int NumberLv = AutoTrainTipsPWin._Lvnumber;//等级所需的等级
|
| | | while (NumberLv > petmodel._DicPetBack[typePetID].PetClass)
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>())
|
| | | {
|
| | | isAutoTrain = false;
|
| | | IsZidong =false;
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6"); |
| | | StopCoroutine("FairyJadeD");
|
| | | yield break;
|
| | | }
|
| | | if (petmodel.Wait)
|
| | | {
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7");
|
| | | int exp = PetClassCostConfig.GetPetIdAndRank(typePetID, petmodel._DicPetBack[typePetID].PetClass).NeedExpTotal;
|
| | | int NeedNum = ridingModel.PetAndHorseNeedDanNum(exp);
|
| | | petmodel.SendPetTrainQuest(petmodel._DicPetBack[typePetID].ItemPlace, NeedNum, 1);//向服务端发包坐骑经验单
|
| | | petmodel.Wait = false;
|
| | | }
|
| | | yield return null;
|
| | | }
|
| | | if (isAutoTrain)
|
| | | {
|
| | | AutoTrainTipsPWin.IsFairy = false;
|
| | | isAutoTrain = false;
|
| | | IsZidong = false;
|
| | | petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
|
| | | StopCoroutine("FairyJadeD");
|
| | | yield break;
|
| | | }
|
| | | yield break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|