Beispiel #1
0
        public void PowerKeyPressUp()
        {
            if (TopViewHelper.Instance.HasModulePageOpened() || !this.okButton.activeSelf)
            {
                return;
            }

            UIStateCompleteSignal.Dispatch(GetStateEnum());
            Stop();
        }
Beispiel #2
0
        private void OpenPropsItemBox(UIState state)
        {
            this.uiPropsBox.SetStatus(true);
            this.uiPropsBox.SetPosition(320.0f, 0.0f);
            this.uiPropsBox.SetPosition(0.0f, 0.5f);
            this.uiPropsBox.uiPropsItems.ForEach(t => t.SetStatus(false));
            MissionInfo missionInfo = this.MissionConfig.GetMissionInfoByMissionId(missionId);

            if (missionInfo != null && this.treasureBoxIndex < missionInfo.listTreasureBox.Count)
            {
                TreasureBox treasureBox = this.TreasureBoxConfig.GetTreasureBoxById(missionInfo.listTreasureBox[this.treasureBoxIndex].BoxId);
                for (int i = 0; i < treasureBox.items.Count; i++)
                {
                    GameObject resource = this.PrefabRoot.GetGameObject("Scenes", this.ItemConifg.GetImage(treasureBox.items[i].itemId));
                    if (resource && resource.GetComponent <SpriteRenderer>() != null)
                    {
                        this.uiPropsBox.uiPropsItems[i].SetStatus(true);
                        this.uiPropsBox.uiPropsItems[i].SetContent(resource.GetComponent <SpriteRenderer>().sprite, treasureBox.items[i].count);
                        this.FundDataManager.AddProperty(treasureBox.items[i].itemId, treasureBox.items[i].count);
                        Destroy(resource);
                    }
                }
            }

            Debug.LogFormat("<><TreasureBoxOpen.OpenPropsItemBox>Sound: {0}, HasModulePageOpened: {1}, InGuideView: {2}",
                            "nim_chest_open_" + LocalPetInfoAgent.getCurrentPet(), TopViewHelper.Instance.HasModulePageOpened(),
                            TopViewHelper.Instance.IsInGuideView());
            if (!TopViewHelper.Instance.HasModulePageOpened() || TopViewHelper.Instance.IsInGuideView())
            {//没有打开任何功能模块或正在引导才能播放此声音
                Debug.LogFormat("<><TreasureBoxOpen.OpenPropsItemBox>Sound: {0} ==== Playing", "nim_chest_open_" + LocalPetInfoAgent.getCurrentPet());
                SoundPlayer.GetInstance().PlaySoundType("nim_chest_open_" + LocalPetInfoAgent.getCurrentPet());
            }

            UIStateCompleteSignal.Dispatch(GetStateEnum());
            okButton.SetActive(true);
        }