Пример #1
0
        public void DeleteMission(MissionItem missionItem)
        {
            IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication();

            isoFile.DeleteFile(missionItem.Name + @".xml");
            isoFile.DeleteFile(missionItem.Name + @".jpg");
        }
Пример #2
0
    //////////////////
    private void InitView()
    {
        if (m_IsInited)
        {
            return;
        }

        List <MissionData> missions = GameDataStorage.Instance.Missions;

        missions.Sort((a, b) =>
        {
            if (a.Number > b.Number)
            {
                return(1);
            }
            else
            {
                return(-1);
            }
        });

        foreach (MissionData mission in missions)
        {
            if (mission.Number > PlayerProfile.Instance.NormalWorldMissionNumber) // здесь указываем максимальный уровень миссии в зависимости от мира, в который идем
            {
                continue;
            }

            MissionItem missionItem = Instantiate(m_MissionPrefab, m_MissionsContainer);
            missionItem.Setinfo(mission);
        }

        m_IsInited = true;
    }
Пример #3
0
        private static async Task <List <MissionItem> > GetSampleMissionPoints(MavsdkSystem drone)
        {
            var dronePosition = await drone.Telemetry.Position().FirstAsync();

            var missionPoints = new List <MissionItem>();
            var missionItem   = new MissionItem();

            missionItem.IsFlyThrough      = true;
            missionItem.SpeedMS           = 2;
            missionItem.RelativeAltitudeM = 5;
            missionItem.LatitudeDeg       = dronePosition.LatitudeDeg;
            missionItem.LongitudeDeg      = dronePosition.LongitudeDeg;

            for (int i = 0; i < 3; i++)
            {
                missionItem = missionItem.Clone();
                if (i % 2 == 0)
                {
                    missionItem.LatitudeDeg += 0.0001;
                }
                else
                {
                    missionItem.LatitudeDeg -= 0.0001;
                }

                missionItem.LongitudeDeg += 0.0001;
                missionPoints.Add(missionItem);
            }

            return(missionPoints);
        }
Пример #4
0
    public void NewMission(string missionDesc, string requestingCountry, string targetCountry = null)
    {
        string desc;

        if (targetCountry != null)
        {
            desc = string.Format("{0} {1} {2}", requestingCountry, missionDesc, targetCountry);
        }
        else
        {
            desc = string.Format("{0}  {1}", requestingCountry, missionDesc);
        }

        MissionClass missionClass = new MissionClass(idCounter, desc, requestingCountry, targetCountry);

        MissionItem missionItem = (MissionItem)Instantiate(missionPrefab);

        missionItem.transform.SetParent(container.transform);
        missionItem.mission       = missionClass;
        missionItem.missionCanvas = missionActionCanvas;

        allMissionList.Add(missionItem);
        idCounter++;
        UpdateMissionCounterText();
    }
Пример #5
0
    private void OpenRewardModalMessage(MissionItem missionItem, bool isAll = false)
    {
        GameWebAPI.RespDataMS_MissionRewardLogic.Result[] result = ClassSingleton <MissionWebAPI> .Instance.MissionRewardLogicData.result;
        int           num  = 0;
        List <string> list = new List <string>
        {
            StringMaster.GetString("Mission-10")
        };

        foreach (GameWebAPI.RespDataMS_MissionRewardLogic.Result result2 in result)
        {
            if (result2.viewFlg == "1")
            {
                int.TryParse(result2.assetCategoryId, out num);
                string assetTitle = DataMng.Instance().GetAssetTitle(result2.assetCategoryId, result2.assetValue);
                string assetNum   = result2.assetNum;
                list.Add(string.Format(StringMaster.GetString("SystemItemCount"), assetTitle, assetNum));
            }
        }
        string       info   = string.Join("\n", list.ToArray());
        Action <int> action = delegate(int a)
        {
            RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_ON);
            APIRequestTask apirequestTask = ClassSingleton <MissionWebAPI> .Instance.AccessMissionInfoLogicAPI();

            apirequestTask.Add(DataMng.Instance().RequestMyPageData(false));
            this.StartCoroutine(apirequestTask.Run(delegate
            {
                if (int.Parse(missionItem.missionCategoryId) == 191 || int.Parse(missionItem.missionCategoryId) == 192)
                {
                    PartsUpperCutinController.AnimeType playType = (!(missionItem.lastStepFlg == "1")) ? PartsUpperCutinController.AnimeType.StageClear : PartsUpperCutinController.AnimeType.MissionClear;
                    Loading.Invisible();
                    this.cutinController.PlayAnimator(playType, delegate
                    {
                        this.RunReMissionInfoLogicAPIHelper();
                    });
                }
                else
                {
                    this.RunReMissionInfoLogicAPIHelper();
                }
            }, delegate(Exception nop)
            {
                RestrictionInput.EndLoad();
                this.ClosePanel(true);
            }, null));
        };
        string title = this.GetTitle(CMD_Mission.nowFocusType);

        this.stringBuilder.Append(title);
        this.stringBuilder.Append(StringMaster.GetString("MissionClearItemGet"));
        CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(action, "CMD_ModalMessage", null) as CMD_ModalMessage;

        cmd_ModalMessage.Title = ((!isAll) ? StringMaster.GetString("Mission-07") : this.stringBuilder.ToString());
        cmd_ModalMessage.Info  = info;
        cmd_ModalMessage.AdjustSize();
        this.stringBuilder.Length = 0;
    }
Пример #6
0
        protected override void ReleaseReferences()
        {
            base.ReleaseReferences();
            _items           = null;
            _selectedMission = null;
            _p = null;

            MissionItem.OnSelect -= OnSelectMissionItem;
        }
Пример #7
0
 private void OnSelectMissionItem(MissionItem missionItem)
 {
     if (_selectedMission != null)
     {
         _selectedMission.Unselect();
     }
     _selectedMission = missionItem;
     _selectedMission.Select();
     _panel.Show(_selectedMission.model);
 }
Пример #8
0
    public void OnPushedButton(MissionItem missionItem)
    {
        RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_ON);
        APIRequestTask task = ClassSingleton <MissionWebAPI> .Instance.AccessMissionRewardLogicAPI(missionItem.missionId);

        base.StartCoroutine(task.Run(delegate
        {
            RestrictionInput.EndLoad();
            this.OpenRewardModalMessage(missionItem, false);
        }, null, null));
    }
Пример #9
0
    public void RequestMissionRewardLogicAPI(List <MissionItem> missionItem)
    {
        RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_ON);
        APIRequestTask task = ClassSingleton <MissionWebAPI> .Instance.AccessMissionRewardLogicAPI(missionItem);

        base.StartCoroutine(task.Run(delegate
        {
            RestrictionInput.EndLoad();
            MissionItem missionItem2 = missionItem.Find((MissionItem data) => data.lastStepFlg == "1");
            this.OpenRewardModalMessage((!(missionItem2 != null)) ? missionItem.First <MissionItem>() : missionItem2, true);
        }, null, null));
    }
Пример #10
0
    public void NewMission(string missionDesc)
    {
        MissionClass missionClass = new MissionClass(idCounter, missionDesc, "France");
        MissionItem  missionItem  = (MissionItem)Instantiate(missionPrefab);

        missionItem.transform.SetParent(container.transform);
        missionItem.mission       = missionClass;
        missionItem.missionCanvas = missionActionCanvas;

        allMissionList.Add(missionItem);
        idCounter++;
        UpdateMissionCounterText();
    }
Пример #11
0
    public ShipsPopup shipsPopup; // Hold Reference for children.
    public override void SpawnList()
    {
        loadingText.SetActive(false);
        foreach (MissionListItem listItem in listItems)
        {
            MissionListItem item   = listItem;
            GameObject      button = pool.RequestAnObject();
            button.transform.SetParent(contentPanel);

            MissionItem missionItem = button.GetComponent <MissionItem>();
            missionItem.Init(item);
        }
    }
Пример #12
0
    //任務道具顯示 20190406
    public void ShowTooltip(MissionItem item)
    {
        ItemNameText.text = item.ItemName;
        ItemSlotText.text = item.missionType.ToString();

        sb.Length = 0;
        AddDescription(item.itemDescription);

        //調整補助道具顯示顏色
        ItemStatText.color = Color.white;
        ItemStatText.text  = sb.ToString();

        gameObject.SetActive(true);
    }
Пример #13
0
    private void _updateMissionView()
    {
        MissionMgr mMgr = (MissionMgr)_engine.getMgr(typeof(MissionMgr));
        Dictionary <int, MissionModel> missions = mMgr.getMissions();

        itemScroll.reset();
        foreach (MissionModel model in missions.Values)
        {
            MissionItem item = (MissionItem)MonoBehaviour.Instantiate(missionItem);
            item.setMission(model);
            itemScroll.addItem(item);
        }

        missionItem.gameObject.SetActive(false);
    }
Пример #14
0
    public void jumpToMissionFromHide()
    {
        MissionItem jumtoItem = null;

        for (int i = 0; i < itemList.Count; i++)
        {
            if (i + 1 >= itemList.Count)
            {
                break;
            }
            if (itemList[i].mission.sid == FuBenManagerment.Instance.selectedMissionSid)
            {
                int    type         = itemList[i].mission.getChapterType();
                int    nextSid      = itemList[i + 1].mission.sid;
                string nextTypeDesc = itemList[i + 1].mission.getMissionType();            //下个副本状态
                string nowTypeDesc  = itemList[i].mission.getMissionType();                //刚才打的副本状态

                if (nextTypeDesc == MissionShowType.NEW || nextTypeDesc == MissionShowType.COUNT_NOT_ENOUGH)
                {
                    jumtoItem = itemList[i + 1];
                }
                else
                {
                    jumtoItem = itemList[i];
                }
            }
        }
        if (jumtoItem == null && lastItem == null)
        {
            missionsParentPos.GetComponent <UICenterOnChild> ().CenterOn(itemList [itemList.Count - 1].transform);
        }
        else if (jumtoItem == null && lastItem != null)
        {
            missionsParentPos.GetComponent <UICenterOnChild> ().CenterOn(lastItem.transform);
        }
        else
        {
            missionsParentPos.GetComponent <UICenterOnChild> ().CenterOn(jumtoItem.transform);
        }
    }
Пример #15
0
        public static void ListMission(List <MissionItem> List, int MonsterID)
        {
            FirebaseDatabase.DefaultInstance.GetReference("/usuarios/" + FirebaseController.UserId + "/missoes/").GetValueAsync().ContinueWith(Task =>
            {
                if (Task.IsFaulted)
                {
                }
                else if (Task.IsCompleted)
                {
                    DataSnapshot Snapshot = Task.Result;

                    foreach (var ChildSnapshot in Snapshot.Children)
                    {
                        if (Convert.ToInt32(ChildSnapshot.Child("nivel").Value) == MonsterID)
                        {
                            var NewMission = new MissionItem();

                            NewMission.MissionID = ChildSnapshot.Key;

                            Debug.Log(ChildSnapshot.Child("objetivo").Value.ToString());

                            NewMission.Name     = ChildSnapshot.Child("objetivo").Value.ToString();
                            NewMission.Type     = ChildSnapshot.Child("tipo").Value.ToString();
                            NewMission.Value    = ChildSnapshot.Child("valor").Value.ToString();
                            NewMission.Total    = ChildSnapshot.Child("total").Value.ToString();
                            NewMission.Verify   = ChildSnapshot.Child("verificada").Value.ToString();
                            NewMission.Complete = ChildSnapshot.Child("concluida").Value.ToString();

                            NewMission.AchievementOne = ChildSnapshot.Child("conquista").Value.ToString();
                            NewMission.AchievementTwo = ChildSnapshot.Child("conquista_final").Value.ToString();

                            NewMission.Difficulty = ChildSnapshot.Child("dificuldade").Value.ToString();

                            MissionItem.Add(NewMission);
                            Debug.Log("Missão adicionada a Lista de Missões.");
                        }
                    }
                }
            });
        }
Пример #16
0
        public void LoadMissions(ViewModel viewModel)
        {
            IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication();

            viewModel.MissionItems.Clear();
            foreach (string fileName in isoFile.GetFileNames())
            {
                string ext = Path.GetExtension(fileName);
                if (@".xml".Equals(ext) && !String.Empty.Equals(Path.GetFileNameWithoutExtension(fileName)))
                {
                    IsolatedStorageFileStream xmlFileStream = isoFile.OpenFile(fileName, FileMode.Open);
                    XDocument missionDoc = XDocument.Load(xmlFileStream);
                    xmlFileStream.Close();
                    XElement    commonElement   = missionDoc.Descendants("common").First();
                    XElement    dateTimeElement = commonElement.Descendants("datetime").First();
                    DateTime    dateTime        = DateTime.Parse(dateTimeElement.Value);
                    MissionItem missionItem     = new MissionItem(MakeMissionName(dateTime));
                    missionItem.When = dateTime;
                    Logger.WriteLine("MissionManager.LoadMissions: Loaded " + missionItem.Name);
                    viewModel.MissionItems.Add(missionItem);
                }
            }
        }
Пример #17
0
    private void ShowTooltip(ItemSlot itemSlot)
    {
        EquippableItem equippableItem = itemSlot.Item as EquippableItem;

        if (equippableItem != null)
        {
            itemTooltip.transform.position = Input.mousePosition;
            itemTooltip.ShowTooltip(equippableItem);
        }

        //新增補助道具顯示功能 20190222
        RestorableItem restorableItem = itemSlot.Item as RestorableItem;

        if (restorableItem != null)
        {
            itemTooltip.transform.position = Input.mousePosition;
            itemTooltip.ShowTooltip(restorableItem);
        }

        MagicalcardItem magicalcardItem = itemSlot.Item as MagicalcardItem;

        if (magicalcardItem != null)
        {
            itemTooltip.transform.position = Input.mousePosition;
            itemTooltip.ShowTooltip(magicalcardItem);
        }

        //新增任務道具顯示功能 20190407
        MissionItem missionItem = itemSlot.Item as MissionItem;

        if (missionItem != null)
        {
            itemTooltip.transform.position = Input.mousePosition;
            itemTooltip.ShowTooltip(missionItem);
        }
    }
Пример #18
0
    public void showGuide(int sid)
    {
        if (UiManager.Instance.getWindow <ExitWindow> () != null && UiManager.Instance.getWindow <ExitWindow> ().gameObject.activeSelf)
        {
            this.gameObject.SetActive(false);
        }
        if (UiManager.Instance.mainWindow != null)
        {
            UiManager.Instance.mainWindow.showIco();
            UiManager.Instance.mainWindow.gridGuideIco();
        }
        for (int i = 0; i < maskButtons.Length; i++)
        {
            maskButtons[i].onceGuide(false);
            maskButtons[i].initCallBack(null);
        }
        bool needShowArrow = false;

        point = GuidePointSampleManager.Instance.getGuidePointSampleBySid(sid);
        friendlyButtonMask.gameObject.SetActive(false);
        friendlyButton.gameObject.SetActive(false);
        clickKuang.gameObject.SetActive(false);

        #region 友情引导
        /**特殊情况的处理 */
        if (point.targetPath == "806001000")          //播放动画
        {
            GuideManager.Instance.withoutFriendlyGuide();
            UiManager.Instance.openWindow <NoticeWindow> ((win) => {
                win.entranceId = NoticeSampleManager.Instance.getNoticeSampleBySid(NoticeType.ONERMB_SID).entranceId;
                win.updateSelectButton(NoticeType.ONERMB_SID);                 //首冲条目写死
            });
            GuideManager.Instance.saveTimes(GuideManager.TypeCash);
            return;
        }
        if (sid > 800000000)
        {
            isFriendlyGuide = true;
            closeGuideMask();
            friendlyButtonMask.gameObject.SetActive(true);
            clickKuang.gameObject.SetActive(true);

            for (int i = 0; i < friendlyMaskButton.Length; i++)
            {
                friendlyMaskButton[i].initCallBack(() => {
                    GuideManager.Instance.withoutFriendlyGuide();
                    closeGuide();
                });
            }

            gameObject.SetActive(true);

            //先判断触控类型
            if (point.clickType == GuideClickType.SCREEN)
            {
                friendlyButton.onceGuide(true);
                friendlyButton.initCallBack(() => {
                    GuideManager.Instance.doFriendlyGuideEvent();
                });
                blinkLabel.gameObject.SetActive(true);
                friendlyButton.gameObject.SetActive(true);
            }
            else if (point.clickType == GuideClickType.SLIDE)
            {
                if (UiManager.Instance.mainWindow == null)
                {
                    return;
                }
                clickKuang.gameObject.SetActive(false);
                UiManager.Instance.mainWindow.maskDragSV.enabled = false;
                StartCoroutine(Utils.DelayRun(() => {
                    if (point.arrowRot == 180)
                    {
                        UiManager.Instance.mainWindow.jumpToPage(2, true);
                    }
                    else if (point.arrowRot == 0)
                    {
                        UiManager.Instance.mainWindow.jumpToPage(0, true);
                    }
                    else
                    {
                        UiManager.Instance.mainWindow.jumpToPage(1, true);
                    }
                }, 0.5f));
            }
            else
            {
                friendlyButton.gameObject.SetActive(false);
            }

            //文字描述
            if (point.texLocal != GuideTexLocalType.NO)
            {
                if (sid >= GuideGlobal.ONCEGUIDE1)
                {
                    descript.text = GuideManager.Instance.getOnceGuideDesc();
                }
                else
                {
                    descript.text = GuideManager.Instance.getGuideDesc();
                }
                labelGroup.SetActive(true);
                labelGroup.transform.position = getTexLocal(point.texLocal);
            }
            else
            {
                labelGroup.SetActive(false);
            }



            guideArrow.transform.localEulerAngles = new Vector3(0, 0, point.arrowRot);
            maxMask.gameObject.SetActive(false);
            if (get2DPointCoord(point.targetPath) == null)
            {
                MonoBase.print("guideUI get2DPointCoord (point.targetPath) == null");
                return;
            }
            targetTrans = get2DPointCoord(point.targetPath);
            box         = get2DPointCoord(point.targetPath).GetComponent <BoxCollider> ();

            if (box == null)
            {
                friendlyButtonMask.position = new Vector3(get2DPointCoord(point.targetPath).position.x, get2DPointCoord(point.targetPath).position.y, friendlyButtonMask.position.z);
                return;
            }
            w     = box.size.x;
            h     = box.size.y;
            scale = UiManager.Instance.fScreenHW > 0.667f ? UiManager.Instance.screenScaleY : UiManager.Instance.screenScaleX;
            float sx = box.transform.localScale.x;
            float sy = box.transform.localScale.y;
            friendlyButtonMask.localScale = new Vector3(w / 100f * scale * sx, h / 100f * scale * sy, 1);
            clickKuang.width  = (int)w;
            clickKuang.height = (int)h;

            if (targetTrans != null)
            {
                UIDragScrollView dsv = targetTrans.GetComponent <UIDragScrollView> ();
                if (dsv != null)
                {
                    dsv.enabled = false;
                }
            }

            return;
        }
        else
        {
            clickKuang.gameObject.SetActive(false);
            isFriendlyGuide = false;
        }

        #endregion

        #region 强制引导

        //事件触控类型判断,表示有箭头指示(全屏指示)
        if (point.clickType == GuideClickType.SCREEN)
        {
            if (sid >= GuideGlobal.ONCEGUIDE1)
            {
                gameObject.SetActive(true);
                guideButton.onceGuide(true);
                if (sid == GuideGlobal.ONCEGUIDE_INVITE1)
                {
                    guideButton.initCallBack(() => {
                        GuideManager.Instance.onceGuideEvent(GuideGlobal.ONCEGUIDE_INVITE2);
                    });
                }
            }
            else
            {
                guideButton.initCallBack(GuideManager.Instance.guideEvent);
            }

            if (point.targetPath != "7")
            {
                guideButton.gameObject.SetActive(true);
                blinkLabel.gameObject.SetActive(true);
            }
        }
        //滑动指示
        else if (point.clickType == GuideClickType.SLIDE)
        {
            if (UiManager.Instance.mainWindow == null)
            {
                return;
            }
            MaskWindow.LockUI();
            UiManager.Instance.mainWindow.maskDragSV.enabled = false;
            StartCoroutine(Utils.DelayRun(() => {
                if (point.arrowRot == 180)
                {
                    UiManager.Instance.mainWindow.jumpToPage(2, true);
                }
                else if (point.arrowRot == 0)
                {
                    UiManager.Instance.mainWindow.jumpToPage(0, true);
                }
                else
                {
                    UiManager.Instance.mainWindow.jumpToPage(1, true);
                }
            }, 0.5f));
        }
        //友善按钮
        else if (point.clickType == GuideClickType.FRIENDLY_BUTTON)
        {
            guideButton.GetComponent <UIDragScrollView> ().enabled = false;
            guideButton.gameObject.SetActive(false);
            for (int i = 0; i < maskButtons.Length; i++)
            {
                maskButtons[i].onceGuide(true);
                maskButtons[i].initCallBack(() => {
                    GuideManager.Instance.jumpGuideSid();
                    closeGuide();
                });
            }
        }
        else
        {
            for (int i = 0; i < maskButtons.Length; i++)
            {
                maskButtons[i].initCallBack(null);
            }
            guideButton.GetComponent <UIDragScrollView> ().enabled = false;
            guideButton.gameObject.SetActive(false);
        }

        //文字说明的位置判断
        if (point.texLocal != GuideTexLocalType.NO)
        {
            if (sid >= GuideGlobal.ONCEGUIDE1)
            {
                descript.text = GuideManager.Instance.getOnceGuideDesc();
            }
            else
            {
                descript.text = GuideManager.Instance.getGuideDesc();
            }
            labelGroup.SetActive(true);
            labelGroup.transform.position = getTexLocal(point.texLocal);
        }
        else
        {
            labelGroup.SetActive(false);
        }
        if (point.targetPath == "1")          //程序定位找主角
        {
            bool       isInSide = false;
            RoleView[] roles    = GameObject.Find("TeamEditWindow").GetComponent <TeamEditWindow> ().teamForRole;
            for (int i = 0; i < roles.Length; i++)
            {
                if (roles [i].card != null && roles [i].card.uid == UserManager.Instance.self.mainCardUid)
                {
                    isInSide     = true;
                    specialTrans = roles [i].gameObject.transform;
                    guideArrow.transform.localEulerAngles = new Vector3(0, 0, point.arrowRot);
                    needShowArrow = true;
                    maxMask.gameObject.SetActive(false);
                }
            }
            if (!isInSide)
            {
                RoleView[] rolesSub = GameObject.Find("TeamEditWindow").GetComponent <TeamEditWindow> ().teamSubRole;
                for (int i = 0; i < rolesSub.Length; i++)
                {
                    if (rolesSub [i].card != null && rolesSub [i].card.uid == UserManager.Instance.self.mainCardUid)
                    {
                        specialTrans = rolesSub [i].gameObject.transform;
                        guideArrow.transform.localEulerAngles = new Vector3(0, 0, point.arrowRot);
                        needShowArrow = true;
                        maxMask.gameObject.SetActive(false);
                    }
                }
            }
        }
        else if (point.targetPath == "7")            //播放动画

        {
        }
        else if (point.targetPath == "6")            //定位卡片第一个被动技能
        {
            CardBookWindow win = GameObject.Find("CardBookWindow").GetComponent <CardBookWindow> ();
            GameObject     a   = win.transform.FindChild("data/content/001/skill/skill/buttonSkill_1").gameObject;
            specialTrans = a.transform;
            guideArrow.transform.localEulerAngles = new Vector3(0, 0, point.arrowRot);
            needShowArrow = true;
            maxMask.gameObject.SetActive(false);
        }
        else if (point.targetPath == "8")            //选择关卡
        {
            MissionItem item = GameObject.Find("MissionChooseWindow").GetComponent <MissionChooseWindow> ().getLastItem();
            if (item != null)
            {
                specialTrans = item.transform;
                guideArrow.transform.localEulerAngles = new Vector3(0, 0, point.arrowRot);
                needShowArrow = true;
                maxMask.gameObject.SetActive(false);
            }
        }
        else if (point.targetPath == "10")            //选择女神
        {
            GameObject item = GameObject.Find("GoddessWindow").GetComponent <GoddessWindow> ().getMyItem().gameObject;
            if (item != null)
            {
                specialTrans = item.transform;
                guideArrow.transform.localEulerAngles = new Vector3(0, 0, point.arrowRot);
                needShowArrow = true;
                maxMask.gameObject.SetActive(false);
            }
        }
        else
        {
            guideArrow.transform.localEulerAngles = new Vector3(0, 0, point.arrowRot);
            needShowArrow = true;
            maxMask.gameObject.SetActive(false);
        }

        //这种情况是有箭头指示的
        if (needShowArrow)
        {
            //表示指示坐标要用2D方法取
            if (point.pointType == GuidePointType.POINT2D)
            {
                if (point.targetPath == "1" || point.targetPath == "6" || point.targetPath == "8" || point.targetPath == "10")
                {
                    if (specialTrans == null)
                    {
                        return;
                    }
                    targetTrans = specialTrans;
                    v3          = specialTrans.position;
                    box         = specialTrans.gameObject.GetComponent <BoxCollider> ();
                }
                else
                {
                    if (get2DPointCoord(point.targetPath) == null)
                    {
                        MonoBase.print("guideUI get2DPointCoord (point.targetPath) == null");
                        return;
                    }
                    targetTrans = get2DPointCoord(point.targetPath);
                    box         = get2DPointCoord(point.targetPath).GetComponent <BoxCollider> ();
                }

                if (box == null)
                {
                    mask.position = new Vector3(get2DPointCoord(point.targetPath).position.x, get2DPointCoord(point.targetPath).position.y, mask.position.z);
                    return;
                }
                w     = box.size.x;
                h     = box.size.y;
                scale = UiManager.Instance.fScreenHW > 0.667f ? UiManager.Instance.screenScaleY : UiManager.Instance.screenScaleX;
                float sx = box.transform.localScale.x;
                float sy = box.transform.localScale.y;
                mask.localScale = new Vector3(w / 100f * scale * sx, h / 100f * scale * sy, 1);
            }
            //表示指示坐标要用3D方法取
            else
            {
                targetTrans = get3DPointCoordTransform(point.targetPath);
            }
        }
        if (targetTrans != null)
        {
            UIDragScrollView dsv = targetTrans.GetComponent <UIDragScrollView> ();
            if (dsv != null)
            {
                dsv.enabled = false;
            }
        }
        //强制引导最后一步,只要箭头,没有遮罩,5秒后玩家没操作就自动进入下一步
//		if (GuideManager.Instance.isEqualStep (30001000)) {
//			closeGuideMask ();
//			StartCoroutine (Utils.DelayRun (()=>{
//				if (GuideManager.Instance.isEqualStep (30001000)) {
//					GuideManager.Instance.doGuide ();
//				}
//			},5f));
//		}
    }
Пример #19
0
    MissionItem missionItem; // Item that requested the popup.

    public void Appear(MissionItem item)
    {
        missionItem = item;
        Appear();
    }
Пример #20
0
 public static Locationwp ConvertFromMissionItem(MissionItem missionItem)
 {
     return missionItem;
 }
Пример #21
0
        public MissionItem SaveMission(int imageWidth, int imageHeight)
        {
            if (!SettingsModel.Instance.PathRecorder)
            {
                return(null);
            }

            if (this.missionName == null)
            {
                Debug.WriteLine("Attempt to save undefined mission");
                return(null);
            }


            // Saving XML
            IsolatedStorageFileStream xmlFileStream = IsolatedStorageFile.GetUserStoreForApplication().CreateFile(missionName + ".xml");

            missionDoc.Save(xmlFileStream);
            xmlFileStream.Close();

            Canvas      canvas   = new Canvas();
            ImageBrush  imgBrush = new ImageBrush();
            BitmapImage bmp      = new BitmapImage();

            bmp.SetSource(Application.GetResourceStream(new Uri(@"Assets/Missions/WhiteBoard.png", UriKind.Relative)).Stream);
            imgBrush.ImageSource = bmp;
            // canvas.Background = imgBrush;
            Image image = new Image();

            image.Source = bmp;
            // canvas.Children.Add(image);
            canvas.Width  = 5;
            canvas.Height = 2;

            TrajectoryRenderer trajectoryRenderer = new TrajectoryRenderer(canvas, (int)Math.Floor(0.8 * imageWidth), (int)Math.Floor(0.8 * imageHeight));

            trajectoryRenderer.StartPath(new SolidColorBrush(Colors.Black), new SolidColorBrush(Colors.White));
            RenderTrajectory(trajectoryRenderer);
            trajectoryRenderer.EndPath();

            TransformGroup tg = new TransformGroup();

            tg.Children.Add(trajectoryRenderer.TransformGroup);
            TranslateTransform tt = new TranslateTransform();

            tt.X = imageWidth / 4;
            tt.Y = imageHeight / 4;
            tg.Children.Add(tt);

            WriteableBitmap wb       = new WriteableBitmap(canvas, tg);
            Canvas          canvas2  = new Canvas();
            Color           bckColor = new Color();

            bckColor.R         = 24;
            bckColor.G         = 41;
            bckColor.B         = 76;
            canvas2.Background = new SolidColorBrush(bckColor);
            Image image2 = new Image();

            image2.Source = wb;
            canvas2.Width = imageWidth;
            canvas2.Width = imageHeight;
            Canvas.SetLeft(canvas, 0.1 * imageWidth);
            Canvas.SetTop(canvas, 0.1 * imageHeight);
            canvas2.Children.Add(image);
            canvas2.Children.Add(canvas);

            WriteableBitmap wb2 = new WriteableBitmap(canvas2, null);

            // Save to IsolatedStorage
            using (var store = IsolatedStorageFile.GetUserStoreForApplication())
                using (var writeStream = new IsolatedStorageFileStream(this.missionName + ".jpg", FileMode.Create, store))
                {
                    wb2.SaveJpeg(writeStream, imageWidth, imageHeight, 0, 100);
                }
            TriggerMessage("Mission saved as " + missionTitle);
            MissionItem missionItem = new MissionItem(this.missionName);

            missionItem.When = this.missionDateTime;
            return(missionItem);
        }
Пример #22
0
    void createItem()
    {
        if (itemList != null)
        {
            itemList.Clear();
            itemList = null;
        }
        lastItem = null;
        itemList = new List <MissionItem> ();
        //解决部分机型高宽不分的BUG
        int        width   = Screen.width < Screen.height ? Screen.width : Screen.height;
        float      y       = 0; //每个副本点位之间的高度差
        float      x       = 0; //每一行X坐标
        float      centerX = 0; //屏幕中间值
        GameObject a;

        for (int i = 0; i < missionList.Length; i++)
        {
            Mission _mission = MissionInfoManager.Instance.getMissionBySid(missionList [i]);
            //根据屏幕宽度来算中间随机的位置
            centerX = (width * UiManager.Instance.screenScaleX) / 2 - (width / 3);
            x       = UnityEngine.Random.Range(-1 * centerX, centerX);
            a       = Instantiate(itemPrefab) as GameObject;
            MissionItem item = a.GetComponent <MissionItem> ();
            item.name = StringKit.intToFixString(i + 1);
            item.initButton(_mission, i + 1);
            item.fatherWindow            = this;
            item.transform.parent        = missionsParentPos;
            item.transform.localScale    = Vector3.one;
            item.transform.localPosition = new Vector3(x, y, 0);
            y += 300;

            if (FuBenManagerment.Instance.isNewMission(_mission.getChapterType(), _mission.sid) && FuBenManagerment.Instance.isCompleteLastMission(_mission.sid))
            {
                lastItem = item;
                NGUITools.AddChild(lastItem.gameObject, newItemRayPrefab);
            }
            itemList.Add(item);
        }

        //这里是连线的
        for (int i = 0; i < itemList.Count; i++)
        {
            if (i + 1 >= itemList.Count)
            {
                break;
            }
            itemList[i].line.gameObject.SetActive(true);
            //计算两点之间的长度
            itemList[i].line.height = (int)Vector2.Distance(itemList[i].getPos(), itemList[i + 1].getPos());
            //计算两点之间的角度
            Vector3 targetDir = itemList[i + 1].line.transform.position - itemList[i].line.transform.position;
            Vector3 forward   = transform.up;
            float   angle     = Vector3.Angle(targetDir, forward);
            if (itemList[i + 1].line.transform.position.x - itemList[i].line.transform.position.x > 0)
            {
                angle = -1 * angle;
            }
            itemList[i].line.transform.eulerAngles = new Vector3(0, 0, angle);
        }
    }
Пример #23
0
 public static Locationwp ConvertFromMissionItem(MissionItem missionItem)
 {
     return(missionItem);
 }