Пример #1
0
 private void ConfirmIsInstance()
 {
     if (this.mMode != PetSelectUI.Mode.Instance)
     {
         return;
     }
     if (PetManager.Instance.IsFormationFromInstance)
     {
         for (int i = 0; i < this.listPetsSelected.get_Count(); i++)
         {
             if (PetManagerBase.IsPetLimit(this.listPetsSelected.get_Item(i)))
             {
                 InstanceManagerUI.ShowLimitMessage();
                 return;
             }
         }
     }
     if (this.listPetsSelected.get_Count() < 3 && this.listPetsShow.get_Count() >= 3)
     {
         DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(510101, false), GameDataUtils.GetChineseContent(510095, false), null, delegate
         {
             PetManager.Instance.SendMsgPetFormation(this.m_formationId, this.listPetsSelected);
         }, GameDataUtils.GetChineseContent(505113, false), GameDataUtils.GetChineseContent(505114, false), "button_orange_1", "button_yellow_1", null, true, true);
         return;
     }
     PetManager.Instance.SendMsgPetFormation(this.m_formationId, this.listPetsSelected);
 }
Пример #2
0
    private void ChooseIsInstance(GameObject sender)
    {
        if (this.mMode != PetSelectUI.Mode.Instance)
        {
            return;
        }
        PetID component = sender.GetComponent <PetID>();

        if (component == null)
        {
            return;
        }
        string[]   array       = sender.get_name().Split("_".ToCharArray());
        int        num         = int.Parse(array[1]);
        GameObject gameObject  = sender.get_transform().FindChild("ImageSelect").get_gameObject();
        PetInfo    petInfoById = PetManager.Instance.GetPetInfoById(num);

        if (petInfoById == null)
        {
            Debug.LogError("宠物不存在, petId = " + num);
            return;
        }
        Pet pet = DataReader <Pet> .Get(num);

        if (pet.fightRoleLv > EntityWorld.Instance.EntSelf.Lv)
        {
            string text = GameDataUtils.GetChineseContent(510112, false);
            text = text.Replace("{s1}", pet.fightRoleLv.ToString());
            UIManagerControl.Instance.ShowToastText(text);
            return;
        }
        if (gameObject.get_activeSelf())
        {
            component.ShowSelect(false);
            component.ShowLimit(PetManager.Instance.IsFormationFromInstance && PetManagerBase.IsPetLimit(petInfoById.petId));
            for (int i = 0; i < this.listPetsSelected.get_Count(); i++)
            {
                if (this.listPetsSelected.get_Item(i) == petInfoById.id)
                {
                    this.listPetsSelected.RemoveAt(i);
                    break;
                }
            }
        }
        else
        {
            if (this.listPetsSelected.get_Count() == this.m_maxPetsCount)
            {
                UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(505132, false));
                return;
            }
            if (PetManager.Instance.IsFormationFromInstance && PetManagerBase.IsPetLimit(petInfoById.petId))
            {
                InstanceManagerUI.ShowLimitMessage();
                return;
            }
            component.ShowSelect(true);
            this.listPetsSelected.Add(petInfoById.id);
        }
    }
Пример #3
0
 public static bool IsPetLimit()
 {
     if (ChangePetChooseUI.limit_pet)
     {
         InstanceManagerUI.ShowLimitMessage();
         return(true);
     }
     return(false);
 }