Ejemplo n.º 1
0
        private void PositionToTask(int taskId)
        {
            Config.missionCell missionCell = missionModel.GetTaskCell(taskId);
            if (missionCell != null && missionCell.skip > 0)
            {
                int progress, goal;
                missionModel.GetTaskProgress(taskId, out progress, out goal);
                if (progress < 1 && missionCell.ParseTaskType() == TaskType.LittleZooLevelup) // 此动物栏还未开启
                {
                    return;
                }

                CloseOthersPageAndTaskPanel();

                TaskType taskType   = missionCell.ParseTaskType();
                int      buildingId = missionCell.GetBuildingId();
                if (taskType == TaskType.ParkingLevelup)
                {
                    PageMgr.ShowPage <UIParkPage>();
                    UIInteractive.GetInstance().iPage = new UIParkPage();
                    PostionSceneTo(GlobalDataManager.GetInstance().zooGameSceneData.GetParkingFocusPoint(buildingId));
                }
                else if (taskType == TaskType.EntryGateLevelup)
                {
                    PageMgr.ShowPage <UIEntryPage>();
                    UIInteractive.GetInstance().iPage = new UIEntryPage();
                    PostionSceneTo(GlobalDataManager.GetInstance().zooGameSceneData.GetEntryGateGroupFocusPoint());
                }
                else if (taskType == TaskType.LittleZooLevelup)
                {
                    PageMgr.ShowPage <UIZooPage>(buildingId);
                    UIInteractive.GetInstance().iPage = new UIZooPage();
                    PostionSceneTo(GlobalDataManager.GetInstance().zooGameSceneData.GetLittleZooFocusPoint(buildingId));
                }
                else if (taskType == TaskType.LittleZooVisit)
                {
                    // 不跳转
                }
                else if (taskType == TaskType.AdWatch)
                {
                    //PageMgr.ShowPage<UIAdvertActivityPage>();

                    PageMgr.ShowPage <UINewCurrencyAdvertPage>(AdTagFM.Add_Double_Advert);
                }
                else if (taskType == TaskType.OpenNewLittleZoo)
                {
                    PageMgr.ShowPage <UIBuildOpenPage>(buildingId);  //开启新的动物园交互
                    UIInteractive.GetInstance().iPage = new UIZooPage();
                    PostionSceneTo(GlobalDataManager.GetInstance().zooGameSceneData.GetLittleZooFocusPoint(buildingId));
                }
            }
        }
Ejemplo n.º 2
0
        private void OnBuildingUnlock(Message message)
        {
            int buildingId = (message as BuildingUnlock).buildingId;

            Config.missionCell missionCell = missionModel.GetTaskCell(missionModel.currTaskId);
            if (missionCell != null && missionCell.ParseTaskType() == TaskType.LittleZooLevelup && missionCell.GetBuildingId() == buildingId)
            {
                missionModel.SetTaskProgress(missionModel.currTaskId, missionModel.ResolveTaskProgress(missionModel.currTaskId));
                GuideMissionStateChanged.Send(missionModel.currTaskId, GuideMissionStateChanged.ChangeDetail_TaskProgress);
            }
        }
Ejemplo n.º 3
0
        private void CheckTasksProgressForBuildingLevelup(TaskType taskType, int buildingProperty, int buildingId, int achieveLevel)
        {
            Config.missionCell missionCell = missionModel.GetTaskCell(missionModel.currTaskId);
            if (missionCell != null)
            {
                TaskType tstype = missionCell.ParseTaskType();

                if (tstype == taskType && buildingProperty == missionCell.ParseBuildingProperty() && buildingId == missionCell.GetBuildingId())
                {
                    if (!missionModel.IsTaskCleared(missionModel.currTaskId))
                    {
                        missionModel.SetTaskProgress(missionModel.currTaskId, achieveLevel);
                        GuideMissionStateChanged.Send(missionModel.currTaskId, GuideMissionStateChanged.ChangeDetail_TaskProgress);
                    }
                    SetTaskStateVars();
                }
            }

            #region -- old

            /*var allCell = missionModel.GetAllTaskCell();
             * Config.missionCell missionCell;
             * TaskType tstype;
             * int progress, goal;
             * int intKey = 0;
             * foreach (string key in allCell.Keys)
             * {
             *  missionCell = allCell[key];
             *  intKey = int.Parse(key);
             *  tstype = missionCell.ParseTaskType();
             *  if (taskType == TaskType.Unknown || taskType == TaskType.AdWatch || taskType == TaskType.LittleZooVisit)
             *      continue;
             *
             *  if (tstype == taskType && buildingProperty == missionCell.ParseBuildingProperty() && buildingId == missionCell.GetBuildingId())
             *  {
             *      missionModel.GetTaskProgress(missionModel.currTaskId, out progress, out goal);
             *      if (!missionModel.IsTaskCleared(intKey))
             *      {
             *          missionModel.SetTaskProgress(missionModel.currTaskId, achieveLevel);
             *          if (intKey == missionModel.currTaskId) // 只有当前进行的任务发送消息
             *              GuideMissionStateChanged.Send(missionModel.currTaskId, GuideMissionStateChanged.ChangeDetail_TaskProgress);
             *      }
             *  }
             * }*/
            #endregion
        }