| | |
| | | public int curPetId { get; set; }
|
| | | public int petUpgradeToolId { get; set; }
|
| | | public int autoActivePetId { get; private set; }
|
| | | public bool hasSendAutoActive { get; private set; }
|
| | |
|
| | | public event Action PlayerLoginOkData;
|
| | | private Dictionary<int, int> DicDefaultPet = new Dictionary<int, int>();
|
| | |
| | | {
|
| | | Wait = true;
|
| | | isServerPrepare = false;
|
| | | hasSendAutoActive = false;
|
| | | _TagPetItem.Clear();
|
| | | _DicPetBack.Clear();
|
| | | PetNow = 0;
|
| | |
| | | PetActivateRedPoint();
|
| | | GetCultivateRedPoint();
|
| | |
|
| | | var config = PetInfoConfig.Get(autoActivePetId);
|
| | | if (config != null && id == config.UnLockNeedItemID)
|
| | | {
|
| | | TryAutoActivePet();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | PetActivateRedPoint();
|
| | | GetCultivateRedPoint();
|
| | |
|
| | | if (isServerPrepare && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Pet))
|
| | | {
|
| | | Clock.AlarmAfter(0.5f, () =>
|
| | | {
|
| | | TryAutoActivePet();
|
| | | });
|
| | | }
|
| | | TryAutoActivePet();
|
| | | }
|
| | | }
|
| | |
|
| | | private void TryAutoActivePet()
|
| | | {
|
| | | var petConfig = PetInfoConfig.Get(autoActivePetId);
|
| | | if (petConfig != null)
|
| | | if (isServerPrepare && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Pet)
|
| | | && !_DicPetBack.ContainsKey(autoActivePetId) && !hasSendAutoActive)
|
| | | {
|
| | | var itemCount = playerPack.GetItemCountByID(PackType.Item, petConfig.UnLockNeedItemID);
|
| | | if (itemCount >= petConfig.UnLockNeedItemCnt)
|
| | | var petConfig = PetInfoConfig.Get(autoActivePetId);
|
| | | if (petConfig != null)
|
| | | {
|
| | | SendBreakPetLockQuest(autoActivePetId);
|
| | | var itemCount = playerPack.GetItemCountByID(PackType.Item, petConfig.UnLockNeedItemID);
|
| | | if (itemCount >= petConfig.UnLockNeedItemCnt)
|
| | | {
|
| | | hasSendAutoActive = true;
|
| | | SendBreakPetLockQuest(autoActivePetId);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|