Exemple #1
0
    private IEnumerator OperatePetMissionCoroutine(int missionId, PetMissionOpt type, List <int> param)
    {
        using (new BlockingLayerHelper(0))
        {
            var array = new Int32Array();
            array.Items.AddRange(param);
            var msg = NetManager.Instance.OperatePetMission(missionId, (int)type, array);
            yield return(msg.SendAndWaitUntilDone());

            if (msg.State == MessageState.Reply)
            {
                if (msg.ErrorCode == (int)ErrorCodes.OK)
                {
                    if (PetMissionOpt.COMPLETE == type)
                    {
                        PlatformHelper.Event("city", "petMissionComplete");
                        var mission       = Instance.GetPetMission(missionId);
                        var tbMissionInfo = Table.GetGetMissionInfo(mission.Level);
                        var count         = mission.PetCount;
                        if (count > 0 && count <= 3)
                        {
                            EventDispatcher.Instance.DispatchEvent(
                                new UIEvent_PetFlyAnim(tbMissionInfo.HomeExp[count - 1]));
                        }
                        EventDispatcher.Instance.DispatchEvent(new ShowUIHintBoard(300207));
                    }
                    //EventDispatcher.Instance.DispatchEvent(new ShowUIHintBoard(300114));
                }
                else
                {
                    UIManager.Instance.ShowNetError(msg.ErrorCode);
                    Logger.Error(".....OperatePetMissionCoroutine.......{0}.", msg.ErrorCode);
                }
            }
            else
            {
                Logger.Error(".....OperatePetMissionCoroutine.......{0}.", msg.State);
            }
        }
    }
Exemple #2
0
 //操作随从任务
 public void OperatePetMission(int missionId, PetMissionOpt type, List <int> param)
 {
     NetManager.Instance.StartCoroutine(OperatePetMissionCoroutine(missionId, type, param));
 }