Exemplo n.º 1
0
        public void Initialize(Mst_bgm_jukebox bgmJukeBoxModel)
        {
            this.mMst_bgm_jukebox = bgmJukeBoxModel;
            string title = string.Format("「{0}」リクエスト中♪", this.mMst_bgm_jukebox.Name);

            this.mUIJukeBoxMusicPlayingRollLabel.Initialize(title);
            List <UIButton> list = new List <UIButton>();

            list.Add(this.mButton_Negative);
            bool flag = this.mMst_bgm_jukebox.Bgm_flag == 1;

            if (flag)
            {
                list.Add(this.mButton_Positive);
                this.mButton_Positive.SetState(UIButtonColor.State.Normal, true);
                this.mButton_Positive.set_enabled(true);
                this.mButton_Positive.isEnabled = true;
            }
            else
            {
                this.mButton_Positive.SetState(UIButtonColor.State.Disabled, true);
                this.mButton_Positive.set_enabled(false);
                this.mButton_Positive.isEnabled = false;
            }
            this.mButtonFocasable = list.ToArray();
            this.mButtonManager.UpdateButtons(this.mButtonFocasable);
            this.ChangeFocus(this.mButton_Negative);
        }
        public override string ToString()
        {
            string text = string.Format("[--PortManager--]\n", new object[0]);

            text += string.Format("{0}\n", base.ToString());
            text += string.Format("海域ID:{0}\n", this.MapArea.Id);
            text += string.Format("指輪の数(ケッコンカッコカリ):{0}\n", this.YubiwaNum);
            DeckModel[] decksFromArea = base.UserInfo.GetDecksFromArea(this.MapArea.Id);
            for (int i = 0; i < decksFromArea.Length; i++)
            {
                DeckModel deckModel = decksFromArea[i];
                text += string.Format("== 艦隊:{0} (母港BGMID:{1})==\n", deckModel, base.UserInfo.GetPortBGMId(deckModel.Id));
                Dictionary <FurnitureKinds, FurnitureModel> furnitures = this.GetFurnitures(deckModel.Id);
                text += string.Format("[設定家具]\n", new object[0]);
                text += string.Format("床:{0}\t壁紙:{1}\t窓:{2}\n", furnitures.get_Item(FurnitureKinds.Floor), furnitures.get_Item(FurnitureKinds.Wall), furnitures.get_Item(FurnitureKinds.Window));
                text += string.Format("壁掛け:{0}\t棚:{1}\t机:{2}\n", furnitures.get_Item(FurnitureKinds.Hangings), furnitures.get_Item(FurnitureKinds.Chest), furnitures.get_Item(FurnitureKinds.Desk));
            }
            List <Mst_bgm_jukebox> jukeboxList = this.GetJukeboxList();

            text += string.Format("[JUKE]\n", new object[0]);
            for (int j = 0; j < jukeboxList.get_Count(); j++)
            {
                Mst_bgm_jukebox mst_bgm_jukebox = jukeboxList.get_Item(j);
                text += string.Format("JUKE{0} {1} 家具コイン:{2} ループ:{3} BGM設定:{4} {5}\n", new object[]
                {
                    mst_bgm_jukebox.Bgm_id,
                    mst_bgm_jukebox.Name,
                    mst_bgm_jukebox.R_coins,
                    mst_bgm_jukebox.Loops,
                    (mst_bgm_jukebox.Bgm_flag != 1) ? "不可" : "可能",
                    mst_bgm_jukebox.Remarks
                });
            }
            return(text + string.Format("[--PortManager--]\n", new object[0]));
        }
        public void Initialize(Mst_bgm_jukebox bgmJukeBoxModel)
        {
            mMst_bgm_jukebox = bgmJukeBoxModel;
            string title = $"「{mMst_bgm_jukebox.Name}」リクエスト中♪";

            mUIJukeBoxMusicPlayingRollLabel.Initialize(title);
            List <UIButton> list = new List <UIButton>();

            list.Add(mButton_Negative);
            if (mMst_bgm_jukebox.Bgm_flag == 1)
            {
                list.Add(mButton_Positive);
                mButton_Positive.SetState(UIButtonColor.State.Normal, immediate: true);
                mButton_Positive.enabled   = true;
                mButton_Positive.isEnabled = true;
            }
            else
            {
                mButton_Positive.SetState(UIButtonColor.State.Disabled, immediate: true);
                mButton_Positive.enabled   = false;
                mButton_Positive.isEnabled = false;
            }
            mButtonFocasable = list.ToArray();
            mButtonManager.UpdateButtons(mButtonFocasable);
            ChangeFocus(mButton_Negative);
        }
Exemplo n.º 4
0
        public void Initialize(Mst_bgm_jukebox jukeBoxBGM, int walletInFurnitureCoin, bool isValidBuy)
        {
            mMst_bgm_jukebox = jukeBoxBGM;
            List <UIButton> list = new List <UIButton>();

            list.Add(mButton_Negative);
            mIsValidBuy           = isValidBuy;
            mLabel_Name.text      = jukeBoxBGM.Name;
            mLabel_Coin_From.text = walletInFurnitureCoin.ToString();
            mLabel_Coin_To.text   = (walletInFurnitureCoin - jukeBoxBGM.R_coins).ToString();
            mLabel_Price.text     = jukeBoxBGM.R_coins.ToString();
            if (mIsValidBuy)
            {
                list.Add(mButton_Positive);
                mButton_Positive.enabled   = true;
                mButton_Positive.isEnabled = true;
            }
            else
            {
                mButton_Positive.enabled   = false;
                mButton_Positive.isEnabled = false;
            }
            if (mMst_bgm_jukebox.Bgm_flag == 1)
            {
                mTransform_Configuable.gameObject.SetActive(true);
            }
            else
            {
                mTransform_Configuable.gameObject.SetActive(false);
            }
            mButtonFocasable = list.ToArray();
            mButtonManager.UpdateButtons(mButtonFocasable);
            ChangeFocus(mButton_Negative);
        }
Exemplo n.º 5
0
        public Api_Result <bool> SetPortBGMFromJukeBoxList(int deck_rid, int music_id)
        {
            Api_Result <bool> api_Result  = new Api_Result <bool>();
            Mst_bgm_jukebox   jukeBoxItem = Mst_DataManager.Instance.GetJukeBoxItem(music_id);

            if (jukeBoxItem == null)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (jukeBoxItem.Bgm_flag == 0)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            api_Result.data = true;
            Mem_room value = null;

            if (!Comm_UserDatas.Instance.User_room.TryGetValue(deck_rid, out value))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            value.SetPortBgmFromJuke(music_id);
            api_Result.state = Api_Result_State.Success;
            api_Result.data  = true;
            return(api_Result);
        }
Exemplo n.º 6
0
        public override string ToString()
        {
            string str = $"[--PortManager--]\n";

            str += $"{base.ToString()}\n";
            str += $"海域ID:{MapArea.Id}\n";
            str += $"指輪の数(ケッコンカッコカリ):{YubiwaNum}\n";
            DeckModel[] decksFromArea = base.UserInfo.GetDecksFromArea(MapArea.Id);
            foreach (DeckModel deckModel in decksFromArea)
            {
                str += $"== 艦隊:{deckModel} (母港BGMID:{base.UserInfo.GetPortBGMId(deckModel.Id)})==\n";
                Dictionary <FurnitureKinds, FurnitureModel> furnitures = GetFurnitures(deckModel.Id);
                str += $"[設定家具]\n";
                str += $"床:{furnitures[FurnitureKinds.Floor]}\t壁紙:{furnitures[FurnitureKinds.Wall]}\t窓:{furnitures[FurnitureKinds.Window]}\n";
                str += $"壁掛け:{furnitures[FurnitureKinds.Hangings]}\t棚:{furnitures[FurnitureKinds.Chest]}\t机:{furnitures[FurnitureKinds.Desk]}\n";
            }
            List <Mst_bgm_jukebox> jukeboxList = GetJukeboxList();

            str += $"[JUKE]\n";
            for (int j = 0; j < jukeboxList.Count; j++)
            {
                Mst_bgm_jukebox mst_bgm_jukebox = jukeboxList[j];
                str += string.Format("JUKE{0} {1} 家具コイン:{2} ル\u30fcプ:{3} BGM設定:{4} {5}\n", mst_bgm_jukebox.Bgm_id, mst_bgm_jukebox.Name, mst_bgm_jukebox.R_coins, mst_bgm_jukebox.Loops, (mst_bgm_jukebox.Bgm_flag != 1) ? "不可" : "可能", mst_bgm_jukebox.Remarks);
            }
            return(str + $"[--PortManager--]\n");
        }
        private void OnPushPlayingState()
        {
            Mst_bgm_jukebox jukeBoxBGM = mContext.GetJukeBoxBGM();

            PlayBGMWithCrossFade(jukeBoxBGM, OnSelectStopPlay);
            mUIJukeBoxMusicPlayingDialog.Initialize(mContext.GetJukeBoxBGM());
            mUIJukeBoxMusicPlayingDialog.SetKeyController(mKeyController);
            mUIJukeBoxMusicPlayingDialog.StartState();
        }
 private void PlayBGMWithCrossFade(Mst_bgm_jukebox jukeBoxBGM, Action onFinished)
 {
     if (this.mPlayBGMWithCrossFadeCoroutine != null)
     {
         base.StopCoroutine(this.mPlayBGMWithCrossFadeCoroutine);
         this.mPlayBGMWithCrossFadeCoroutine = null;
     }
     this.mPlayBGMWithCrossFadeCoroutine = this.CrossFadeToBGMCoroutine(jukeBoxBGM, onFinished);
     base.StartCoroutine(this.mPlayBGMWithCrossFadeCoroutine);
 }
 private void PlayBGMWithCrossFade(Mst_bgm_jukebox jukeBoxBGM, Action onFinished)
 {
     if (mPlayBGMWithCrossFadeCoroutine != null)
     {
         StopCoroutine(mPlayBGMWithCrossFadeCoroutine);
         mPlayBGMWithCrossFadeCoroutine = null;
     }
     mPlayBGMWithCrossFadeCoroutine = CrossFadeToBGMCoroutine(jukeBoxBGM, onFinished);
     StartCoroutine(mPlayBGMWithCrossFadeCoroutine);
 }
 private void OnSelectedMusicListener(Mst_bgm_jukebox jukeBoxBGM)
 {
     this.mKeyController.ClearKeyAll();
     this.mKeyController.firstUpdate = true;
     if (jukeBoxBGM.R_coins <= this.mPortManager.UserInfo.FCoin)
     {
         this.mUIJukeBoxPlayListParent.LockState();
         this.mUIJukeBoxPlayListParent.SetKeyController(null);
         this.mContext.SetJukeBoxBGM(jukeBoxBGM);
         this.mStateManager.PushState(UserInterfaceJukeBoxManager.State.BuyMusicConfirm);
     }
     else
     {
         CommonPopupDialog.Instance.StartPopup("家具コインが不足しています");
     }
 }
Exemplo n.º 11
0
        public Api_Result <bool> BuyMusic(int deck_rid, int music_id)
        {
            Api_Result <bool> api_Result  = new Api_Result <bool>();
            Mst_bgm_jukebox   jukeBoxItem = Mst_DataManager.Instance.GetJukeBoxItem(music_id);

            if (jukeBoxItem == null)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (Comm_UserDatas.Instance.User_basic.Fcoin < jukeBoxItem.R_coins)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            Comm_UserDatas.Instance.User_basic.SubCoin(jukeBoxItem.R_coins);
            api_Result.state = Api_Result_State.Success;
            api_Result.data  = true;
            return(api_Result);
        }
Exemplo n.º 12
0
 private void OnDestroy()
 {
     mButtonManager            = null;
     mPanelThis                = null;
     mButton_Negative          = null;
     mButton_Positive          = null;
     mLabel_Name               = null;
     mLabel_Coin_From          = null;
     mLabel_Coin_To            = null;
     mLabel_Price              = null;
     mTransform_Configuable    = null;
     mOnRequestBackToRoot      = null;
     mOnSelectPositiveListener = null;
     mOnSelectNegativeListener = null;
     mButtonCurrentFocus       = null;
     mOnRequestChangeScene     = null;
     mKeyController            = null;
     mButtonFocasable          = null;
     mMst_bgm_jukebox          = null;
 }
 private void OnSelectPositiveJukeBoxMusicBuy()
 {
     if (mStateManager.CurrentState == State.BuyMusicConfirm)
     {
         Mst_bgm_jukebox jukeBoxBGM = mContext.GetJukeBoxBGM();
         int             fCoin      = mPortManager.UserInfo.FCoin;
         if (jukeBoxBGM.R_coins <= fCoin)
         {
             mPortManager.PlayJukeboxBGM(mDeckId, jukeBoxBGM.Bgm_id);
             mKeyController.ClearKeyAll();
             mKeyController.firstUpdate = true;
             mStateManager.PopState();
             mStateManager.PushState(State.Playing);
         }
         else
         {
             CommonPopupDialog.Instance.StartPopup("家具コインが不足しています");
         }
     }
 }
Exemplo n.º 14
0
 private void OnDestroy()
 {
     this.mButtonManager                  = null;
     this.mPanelThis                      = null;
     this.mTransform_YouseiOffset         = null;
     this.mTexture_Yousei                 = null;
     this.mTexture2d_Yousei_Frame_0       = null;
     this.mTexture2d_Yousei_Frame_1       = null;
     this.mTexture2d_Yousei_Frame_2       = null;
     this.mButton_Negative                = null;
     this.mButton_Positive                = null;
     this.mUIJukeBoxMusicPlayingRollLabel = null;
     this.mOnRequestBackToRoot            = null;
     this.mOnSelectPositiveListener       = null;
     this.mOnSelectNegativeListener       = null;
     this.mButtonCurrentFocus             = null;
     this.mOnRequestChangeScene           = null;
     this.mMst_bgm_jukebox                = null;
     this.mKeyController                  = null;
     this.mButtonFocasable                = null;
 }
        private IEnumerator CrossFadeToBGMCoroutine(Mst_bgm_jukebox jukeBoxBGM, Action onFinishedPlayBGM)
        {
            if (DOTween.IsTweening(SingletonMonoBehaviour <SoundManager> .Instance))
            {
                DOTween.Kill(SingletonMonoBehaviour <SoundManager> .Instance, complete: true);
            }
            BGMFileInfos bgmFileInfos = (BGMFileInfos)jukeBoxBGM.Bgm_id;

            yield return(new WaitForEndOfFrame());

            Tween fadeOutVolume = DOVirtual.Float(mDefaultVolume, 0f, 0.3f, delegate(float volume)
            {
                SingletonMonoBehaviour <SoundManager> .Instance.bgmSource.volume = volume;
            });

            yield return(fadeOutVolume.WaitForCompletion());

            AudioSource jukeAudioSource = SingletonMonoBehaviour <SoundManager> .Instance.GeneratePlayJukeAudioSource(bgmFileInfos);

            jukeAudioSource.volume = mDefaultVolume;
            jukeAudioSource.Stop();
            jukeAudioSource.Play();
            int loopCounter = 0;

            jukeAudioSource.loop = false;
            for (; loopCounter < jukeBoxBGM.Loops; loopCounter++)
            {
                jukeAudioSource.Stop();
                jukeAudioSource.Play();
                while (jukeAudioSource.isPlaying)
                {
                    yield return(null);
                }
            }
            onFinishedPlayBGM?.Invoke();
        }
 public void SetJukeBoxBGM(Mst_bgm_jukebox jukeBoxBGM)
 {
     this.mBgmJukeBox = jukeBoxBGM;
 }
 private IEnumerator CrossFadeToBGMCoroutine(Mst_bgm_jukebox jukeBoxBGM, Action onFinishedPlayBGM)
 {
     UserInterfaceJukeBoxManager.< CrossFadeToBGMCoroutine > c__IteratorA1 <CrossFadeToBGMCoroutine> c__IteratorA = new UserInterfaceJukeBoxManager.< CrossFadeToBGMCoroutine > c__IteratorA1();