public void QuitLearnView(bool finishLearning)
        {
            Time.timeScale = 1f;

            if (finishLearning)
            {
                UpdateDataBase();
                UpdatePlayerData();
            }

            ClearCache();

            learnView.QuitLearnView();

            Transform em = TransformManager.FindTransform("ExploreManager");

            if (em != null)
            {
                GameManager.Instance.UIManager.HideCanvas("LearnCanvas");
                SoundManager.Instance.ResumeBgm();
                if (finishLearning)
                {
                    ExploreManager exploreManager = em.GetComponent <ExploreManager> ();
                    exploreManager.ChangeCrystalStatus();
                    exploreManager.expUICtr.UpdatePlayerStatusBar();
                }
            }
            else
            {
                GameManager.Instance.UIManager.SetUpCanvasWith(CommonData.homeCanvasBundleName, "HomeCanvas", () => {
                    TransformManager.FindTransform("HomeCanvas").GetComponent <HomeViewController>().SetUpHomeView();
                });
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 角色卸下装备
        /// </summary>
        /// <param name="equipment">Equipment.</param>
        /// <param name="equipmentIndexInPanel">Equipment index in panel.</param>
        public PropertyChange UnloadEquipment(Equipment equipment, int equipmentIndexInPanel, int indexInBag = -1)
        {
            SoundManager.Instance.PlayAudioClip("UI/sfx_UI_Equipment");

            equipment.equiped = false;

            Debug.LogFormat("卸下装备{0}/{1}", equipmentIndexInPanel, allEquipedEquipments.Length);

            if (equipment.itemId < 0)
            {
                return(new PropertyChange());
            }

            if (indexInBag == -1)
            {
                allItemsInBag.Add(equipment);
            }
            else
            {
                allItemsInBag.Insert(indexInBag, equipment);
            }

            for (int i = 0; i < equipment.attachedSkills.Count; i++)
            {
                TriggeredSkill attachedSkill = equipment.attachedSkills [i];
                attachedTriggeredSkills.Remove(attachedSkill);
                if (!(battleAgentCtr as BattlePlayerController).isInFight)
                {
                    equipment.attachedSkills.Remove(attachedSkill);
                    Destroy(attachedSkill.gameObject);
                    i--;
                }
            }

            Equipment emptyEquipment = new Equipment();

            allEquipedEquipments [equipmentIndexInPanel] = emptyEquipment;

            PropertyChange pc = ResetBattleAgentProperties(false);

            Transform exploreManager = TransformManager.FindTransform("ExploreManager");

            if (exploreManager != null)
            {
                ExploreManager manager = exploreManager.GetComponent <ExploreManager> ();
                manager.UpdatePlayerPropertyCalculator();
                manager.UpdateTriggeredCallBacks();
                manager.UpdatePlayerStatusPlane();
            }


            return(pc);
        }
Exemplo n.º 3
0
        public void OnAgentPushBox(BattlePlayerController bp, MapGenerator mapGenerator)
        {
            this.mapGenerator = mapGenerator;

            ExploreManager em = mapGenerator.GetComponent <ExploreManager> ();

            em.DisableInteractivity();

            int[,] mapWalkableInfo = mapGenerator.mapWalkableInfoArray;

            int playerPosX = Mathf.RoundToInt(bp.transform.position.x);
            int playerPosY = Mathf.RoundToInt(bp.transform.position.y);

            int boxPosX = Mathf.RoundToInt(this.transform.position.x);
            int boxPosY = Mathf.RoundToInt(this.transform.position.y);


            if (playerPosX < boxPosX && CanMoveTo(boxPosX + 1, boxPosY))
            {
                this.transform.DOMove(new Vector3(boxPosX + 1, boxPosY), 1.0f).OnComplete(delegate {
                    mapWalkableInfo[boxPosX, boxPosY]     = 1;
                    mapWalkableInfo[boxPosX + 1, boxPosY] = 0;
                    em.EnableInteractivity();
                });
            }
            else if (playerPosX > boxPosX && CanMoveTo(boxPosX - 1, boxPosY))
            {
                this.transform.DOMove(new Vector3(boxPosX - 1, boxPosY), 1.0f).OnComplete(delegate {
                    mapWalkableInfo[boxPosX, boxPosY]     = 1;
                    mapWalkableInfo[boxPosX - 1, boxPosY] = 0;
                    em.EnableInteractivity();
                });
            }
            else if (playerPosY < boxPosY && CanMoveTo(boxPosX, boxPosY + 1))
            {
                this.transform.DOMove(new Vector3(boxPosX, boxPosY + 1), 1.0f).OnComplete(delegate {
                    mapWalkableInfo[boxPosX, boxPosY]     = 1;
                    mapWalkableInfo[boxPosX, boxPosY + 1] = 0;
                    em.EnableInteractivity();
                });
            }
            else if (playerPosY > boxPosY && CanMoveTo(boxPosX, boxPosY - 1))
            {
                this.transform.DOMove(new Vector3(boxPosX, boxPosY - 1), 1.0f).OnComplete(delegate {
                    mapWalkableInfo[boxPosX, boxPosY]     = 1;
                    mapWalkableInfo[boxPosX, boxPosY - 1] = 0;
                    em.EnableInteractivity();
                });
            }

            em.EnableInteractivity();
        }
Exemplo n.º 4
0
        /// <summary>
        /// 角色穿上装备
        /// </summary>
        /// <param name="equipment">Equipment.</param>
        /// <param name="equipmentIndexInPanel">Equipment index in panel.</param>
        public PropertyChange EquipEquipment(Equipment equipment, int equipmentIndexInPanel)
        {
            SoundManager.Instance.PlayAudioClip("UI/sfx_UI_Equipment");

            equipment.equiped = true;

            Debug.LogFormat("穿上装备{0}", equipmentIndexInPanel);

            allEquipedEquipments [equipmentIndexInPanel] = equipment;

//			equipmentDragControl.item = equipment;

            if (equipment.attachedSkills.Count == 0)
            {
                for (int i = 0; i < equipment.attachedSkillInfos.Length; i++)
                {
                    TriggeredSkill attachedSkill = SkillGenerator.Instance.GenerateTriggeredSkill(equipment, equipment.attachedSkillInfos [i], triggeredSkillsContainer);
                    equipment.attachedSkills.Add(attachedSkill);
                    attachedTriggeredSkills.Add(attachedSkill);
                    attachedSkill.transform.SetParent(triggeredSkillsContainer);
                }
            }
            else
            {
                for (int i = 0; i < equipment.attachedSkills.Count; i++)
                {
                    TriggeredSkill attachedSkill = equipment.attachedSkills [i];
                    attachedTriggeredSkills.Add(attachedSkill);
                }
            }

            allItemsInBag.Remove(equipment);

            PropertyChange pc = ResetBattleAgentProperties(false);

            Transform exploreManager = TransformManager.FindTransform("ExploreManager");

            if (exploreManager != null)
            {
                ExploreManager manager = exploreManager.GetComponent <ExploreManager> ();
                manager.UpdatePlayerPropertyCalculator();
                manager.UpdateTriggeredCallBacks();
                manager.UpdatePlayerStatusPlane();
            }

            return(pc);
        }
        /// <summary>
        /// 退出npc交互界面
        /// </summary>
        public void QuitNPCPlane()
        {
            ExploreManager.Instance.expUICtr.HideTopBarMask();

            ExploreManager.Instance.expUICtr.rejectNewUI = false;

            if (npc == null)
            {
                return;
            }

            for (int i = 0; i < GameManager.Instance.gameDataCenter.currentMapEventsRecord.npcArray.Length; i++)
            {
                HLHNPC tempNpc = GameManager.Instance.gameDataCenter.currentMapEventsRecord.npcArray[i];
                if (tempNpc != null && tempNpc.npcId == npc.npcId)
                {
                    GameManager.Instance.gameDataCenter.currentMapEventsRecord.npcArray[i] = npc;
                    break;
                }
            }


            dialogText.text = string.Empty;

            npc = null;

            MapNPC mn = ExploreManager.Instance.currentEnteredMapEvent as MapNPC;

            ExploreManager.Instance.battlePlayerCtr.isInEvent           = false;
            ExploreManager.Instance.battlePlayerCtr.boxCollider.enabled = true;

            mn.isTriggered = false;

            ExploreManager exploreManager = ExploreManager.Instance;

            exploreManager.MapWalkableEventsStartAction();

            mn.RefreshWalkableInfoWhenQuit(false);

            exploreManager.EnableExploreInteractivity();

            GameManager.Instance.UIManager.HideCanvas("NPCCanvas");
        }
Exemplo n.º 6
0
        public void OnConfirmButtonClick()
        {
            queryContainer.gameObject.SetActive(false);

            QuitPauseHUD();

            ExploreManager exploreManager = TransformManager.FindTransform("ExploreManager").GetComponent <ExploreManager> ();

            switch (queryType)
            {
            case QueryType.Refresh:
                exploreManager.RefrestCurrentLevel();
                break;

            case QueryType.BackHome:
                exploreManager.QuitExploreScene(false);
                break;
            }
        }
        public void OnConfirmButtonClick()
        {
//			int wordTypeIndex = settingView.GetCurrentWordType (index);
//
//			if (wordTypeIndex == -1) {
//				return;
//			}

            settingView.QuitAlertHUD();

            GameManager.Instance.persistDataManager.ResetPlayerDataToOriginal();

            switch (currentSelectWordTypeIndex)
            {
            case 0:
                GameManager.Instance.gameDataCenter.gameSettings.wordType = WordType.CET4;
                break;

            case 1:
                GameManager.Instance.gameDataCenter.gameSettings.wordType = WordType.CET6;
                break;

            case 2:
                GameManager.Instance.gameDataCenter.gameSettings.wordType = WordType.Daily;
                break;

            case 3:
                GameManager.Instance.gameDataCenter.gameSettings.wordType = WordType.Bussiness;
                break;
            }

            ExploreManager exploreManager = TransformManager.FindTransform("ExploreManager").GetComponent <ExploreManager> ();

            if (exploreManager != null)
            {
                exploreManager.QuitExploreScene(false);
            }

            settingChanged = true;
            OnQuitSettingViewButtonClick();
        }
        /// <summary>
        /// 玩家死亡
        /// </summary>
        override public void AgentDie()
        {
            if (agent.isDead)
            {
                return;
            }

            agent.isDead = true;

            StopCoroutinesWhenFightEnd();

            // 如果是在战斗中死亡的
            if (bmCtr != null)
            {
                bmCtr.StopCoroutinesWhenFightEnd();

                ActiveBattlePlayer(false, false, true);

                ExploreManager em = exploreManager.GetComponent <ExploreManager> ();

                em.DisableInteractivity();

                PlayRoleAnim("die", 1, () => {
                    em.BattlePlayerLose();
                });

                return;
            }

            // 如果不是在战斗中死亡的
            PlayRoleAnim("die", 1, () => {
                agent.ResetBattleAgentProperties(true);

                exploreManager.GetComponent <ExploreManager>().QuitExploreScene(false);
            });
        }