void Handle_InputKey(int control, HpyInputKey key, bool down) { if (!IsControlable) return; if (down && key == HpyInputKey.BS_Up) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } //else if (!down && key == HpyInputKey.BS_Up) //{ // //StopCoroutine("_Coro_SelectPrev"); //} else if (down && key == HpyInputKey.BS_Down) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } //else if (!down && key == HpyInputKey.BS_Down) //{ // //StopCoroutine("_Coro_SelectNext"); //} if (down && key == HpyInputKey.BS_Confirm) { if (EvtConfirm != null) EvtConfirm(mCurCursorIdx); } }
void HandleBackGroundKeyEvent(int control, HpyInputKey key, bool down) { //����Ϸ�� if (GameMain.Singleton.IsInBackstage) { return; } if (down && key == HpyInputKey.BS_Left) { StartCoroutine("_Coro_ChangeVol", -1); } else if (down && key == HpyInputKey.BS_Right) { StartCoroutine("_Coro_ChangeVol", 1); } else if (!down && key == HpyInputKey.BS_Left) { StopCoroutine("_Coro_ChangeVol"); } else if (!down && key == HpyInputKey.BS_Right) { StopCoroutine("_Coro_ChangeVol"); } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (!IsControlable) { return; } if (down && key == HpyInputKey.BS_Up) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } //else if (!down && key == HpyInputKey.BS_Up) //{ // //StopCoroutine("_Coro_SelectPrev"); //} else if (down && key == HpyInputKey.BS_Down) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } //else if (!down && key == HpyInputKey.BS_Down) //{ // //StopCoroutine("_Coro_SelectNext"); //} if (down && key == HpyInputKey.BS_Confirm) { if (EvtConfirm != null) { EvtConfirm(mCurCursorIdx); } } }
void Handle_InputKey(int pIdx, HpyInputKey k, bool down) { Player p = mGM.Players[pIdx]; if (down && k == HpyInputKey.Down) { if (mFishLocker[p.Idx] != null) { Fish f = mFishLocker[p.Idx].Lock(); if (f != null) { LockAt(p, f); } } } else if (!down && k == HpyInputKey.Down) { if (mFishLocker != null) { mFishLocker[p.Idx].UnLock(); UnLock(p); } } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (!mIsInputable) { return; } if (down && key == HpyInputKey.BS_Up) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } else if (!down && key == HpyInputKey.BS_Up) { //StopCoroutine("_Coro_SelectPrev"); } else if (down && key == HpyInputKey.BS_Down) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } else if (!down && key == HpyInputKey.BS_Down) { //StopCoroutine("_Coro_SelectNext"); } else if (down && key == HpyInputKey.BS_Confirm) { if (mCurCursorIdx == 0) { //ֱ����ʱ GameMain.Singleton.BSSetting.Dat_CodePrintDateTime.Val = System.DateTime.Now.Ticks; //Ч����ʾ StartCoroutine(_Coro_RuntimeAdvanceAndDelayQuit()); //��ֹ���� mIsInputable = false; //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } else if (mCurCursorIdx == 1) { gameObject.SetActiveRecursively(false); //BackstageMain.Singleton.WndCodePrint.gameObject.SetActiveRecursively(true); BackstageMain.Singleton.WndCodePrint.Enter(); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } } }
void Handle_DirectCtrlUp() { mDirectCtrlling = false; if (mPreDirectState != HpyInputKey.BS_GameLite) { GameMain.EvtInputKey(0, mPreDirectState, false); } mPreDirectState = HpyInputKey.BS_GameLite; }
void Handle_Input(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Cancel) { gameObject.SetActiveRecursively(false); BackstageMain.Singleton.WndMainMenu.gameObject.SetActiveRecursively(true); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } }
void Handle_Input(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Cancel) { gameObject.SetActiveRecursively(false); BackstageMain.Singleton.WndMainMenu.gameObject.SetActiveRecursively(true); //ÒôЧ-ºǫ́ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (!mIsInputable) return; if (down && key == HpyInputKey.BS_Up) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } else if (!down && key == HpyInputKey.BS_Up) { //StopCoroutine("_Coro_SelectPrev"); } else if (down && key == HpyInputKey.BS_Down) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } else if (!down && key == HpyInputKey.BS_Down) { //StopCoroutine("_Coro_SelectNext"); } else if (down && key == HpyInputKey.BS_Confirm) { if (mCurCursorIdx == 0) { //ֱ����ʱ GameMain.Singleton.BSSetting.Dat_CodePrintDateTime.Val = System.DateTime.Now.Ticks; //Ч����ʾ StartCoroutine(_Coro_RuntimeAdvanceAndDelayQuit()); //��ֹ���� mIsInputable = false; //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } else if (mCurCursorIdx == 1) { gameObject.SetActiveRecursively(false); //BackstageMain.Singleton.WndCodePrint.gameObject.SetActiveRecursively(true); BackstageMain.Singleton.WndCodePrint.Enter(); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } }
void Handle_InputKey(int p, HpyInputKey k, bool down) { Players[p].OnKeyDown(k, down); if (down && k == HpyInputKey.BS_Confirm) { StartCoroutine("_Coro_PrepareEnterBackStage"); } else if (!down && k == HpyInputKey.BS_Confirm) { StopCoroutine("_Coro_PrepareEnterBackStage"); } if (down && k == HpyInputKey.OutBounty) { Players[p].OutBountyButtom(); } if (down && (k == HpyInputKey.BS_Up || k == HpyInputKey.BS_Down)) { if (!mIsEnteringBackstage) { if (mCurGameDataViewer == null) { mCurGameDataViewer = Instantiate(Prefab_GameDataViewer) as GameDataViewer; mCurGameDataViewer.IsOnlyViewNumber = k == HpyInputKey.BS_Up ? false : true; mCurGameDataViewer.transform.position = new Vector3(WorldDimension.xMin, WorldDimension.yMax, Defines.GlobleDepth_GameDataViewer); if (ScreenNumUsing > 1) { for (int i = 0; i != ScreenNumUsing - 1; ++i) { GameDataViewer gdv = Instantiate(Prefab_GameDataViewer) as GameDataViewer; gdv.transform.parent = mCurGameDataViewer.transform; gdv.transform.position = new Vector3(WorldDimension.xMin + Defines.WorldDimensionUnit.width * (i + 1) , WorldDimension.yMax, Defines.GlobleDepth_GameDataViewer); } } } else { Destroy(mCurGameDataViewer.gameObject); mCurGameDataViewer = null; } } } }
void Handle_Input(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Left) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } else if (!down && key == HpyInputKey.BS_Left) { //StopCoroutine("_Coro_SelectPrev"); } else if (down && key == HpyInputKey.BS_Right) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } else if (!down && key == HpyInputKey.BS_Right) { //StopCoroutine("_Coro_SelectNext"); } else if (down && key == HpyInputKey.BS_Confirm) { if (EvtResult != null) { EvtResult(mCurIdx); } //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } else if (down && key == HpyInputKey.BS_Cancel) { gameObject.SetActiveRecursively(false); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (down && (key == HpyInputKey.BS_Up || key == HpyInputKey.BS_Down)) { StopCoroutine("_Coro_PlaySound"); StartCoroutine("_Coro_PlaySound"); } else if (!down && (key == HpyInputKey.BS_Up || key == HpyInputKey.BS_Down)) { StopCoroutine("_Coro_PlaySound"); } if (down && key == HpyInputKey.BS_Confirm) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); BackToMainMenu(); } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Cancel) { StopCoroutine("_Coro_DelayViewVersion"); StartCoroutine("_Coro_DelayViewVersion"); } else if (!down && key == HpyInputKey.BS_Cancel) { StopCoroutine("_Coro_DelayViewVersion"); for (int i = 0; i < GameMain.Singleton.ScreenNumUsing; i++) { if (mViewingText[i] != null) { Destroy(mViewingText[i].gameObject); mViewingText[i] = null; } } } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (down && (key == HpyInputKey.BS_Up || key == HpyInputKey.BS_Down)) { StopCoroutine("_Coro_PlaySound"); StartCoroutine("_Coro_PlaySound"); } else if (!down && (key == HpyInputKey.BS_Up || key == HpyInputKey.BS_Down)) { StopCoroutine("_Coro_PlaySound"); } if (down && key == HpyInputKey.BS_Confirm) { //音效-后台 if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } BackToMainMenu(); } }
void Handle_InputKey( int control, HpyInputKey key, bool down ) { if (down && key == HpyInputKey.BS_Cancel) { StopCoroutine("_Coro_DelayViewVersion"); StartCoroutine("_Coro_DelayViewVersion"); } else if (!down && key == HpyInputKey.BS_Cancel) { StopCoroutine("_Coro_DelayViewVersion"); for(int i = 0; i < GameMain.Singleton.ScreenNumUsing; i++) { if(mViewingText[i] != null) { Destroy( mViewingText[i].gameObject ); mViewingText[i] = null; } } } }
void Handle_Input(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Left) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } else if (!down && key == HpyInputKey.BS_Left) { //StopCoroutine("_Coro_SelectPrev"); } else if (down && key == HpyInputKey.BS_Right) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } else if (!down && key == HpyInputKey.BS_Right) { //StopCoroutine("_Coro_SelectNext"); } else if (down && key == HpyInputKey.BS_Confirm) { if(EvtResult != null) EvtResult(mCurIdx); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } else if (down && key == HpyInputKey.BS_Cancel) { gameObject.SetActiveRecursively(false); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } }
void Handle_InputKey(int pIdx, HpyInputKey k, bool down) { Player p = mGM.Players[pIdx]; if (down && k == HpyInputKey.Down) { if (mFishLocker[p.Idx] != null) { Fish f = mFishLocker[p.Idx].Lock(); if (f != null) LockAt(p,f); } } else if (!down && k == HpyInputKey.Down) { if (mFishLocker != null) { mFishLocker[p.Idx].UnLock(); UnLock(p); } } }
void Handle_Input(int control, HpyInputKey key, bool down) { if (key == HpyInputKey.BS_Cancel && down) { if (mCurNumInputer != null) { Destroy(mCurNumInputer.gameObject); mCurNumInputer = null; mCurWndOptioner.IsControlable = true; } } else if ((key == HpyInputKey.BS_Left || key == HpyInputKey.BS_Right) && down) { if (mCurSelectIdx == 4) { Transform ts = mCurWndOptioner.transform.Find("option4/ctrl_��ǰ��ʾ״̬"); Ctrl_OptionText ctrlOption = null; if (ts != null) { ctrlOption = ts.GetComponent <Ctrl_OptionText>(); } if (ctrlOption != null) { PersistentData <bool, bool> isShowLanguageSetup = GameMain.Singleton.BSSetting.Dat_GameShowLanguageSetup; isShowLanguageSetup.Val = !isShowLanguageSetup.Val; ctrlOption.ViewIdx = isShowLanguageSetup.Val ? 0 : 1; ctrlOption.UpdateText(); } else { Debug.LogError("ctrlOption == null"); } } } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { #region keydown if (down && key == HpyInputKey.BS_Up) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } else if (down && key == HpyInputKey.BS_Down) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } else if (down && key == HpyInputKey.BS_Left) { if (mCurCursorIdx == (int)Option.Difficult)//���� { Ctrl_GameDifficul.StartChange(false); } else if (mCurCursorIdx == (int)Option.CoinTicketRatio)//��Ʊ���� { if (mCurrentCoinTicketRotioSelect == null) { mCurrentCoinTicketRotioSelect = Ctrl_CoinTicketRatio_Coin; mCurrentCoinTicketRotioSelect.GetComponent <Ef_RendererFlash>().StartFlash(); } else { mCurrentCoinTicketRotioSelect.GetComponent <Ef_RendererFlash>().StopFlash(); mCurrentCoinTicketRotioSelect.StartChangeNumViewing(-1); } mIsMainMenuMovable = false;//���˵������ƶ� } else if (mCurCursorIdx == (int)Option._OutBountyType) { Ctrl_OutBountyType.StartChange(false); } else if (mCurCursorIdx == (int)Option._GunLayoutType) { Ctrl_GunLayouType.StartChange(false); } //else if (mCurCursorIdx == 4) // Ctrl_IsBulletCross.StartChange(false); else if (mCurCursorIdx == (int)Option.ScoreChange) { Ctrl_ScoreChangeVal.StartChangeNumViewing((int cur) => { return(-GetChangeValL(cur)); }); } //else if (mCurCursorIdx == 6) // Ctrl_MinScore.StartChangeNumViewing((int cur) => { return -GetChangeValL(cur); }); else if (mCurCursorIdx == (int)Option.MaxGunScore) { Ctrl_MaxScore.StartChangeNumViewing((int cur) => { return(-GetChangeValL(cur)); }); } else if (mCurCursorIdx == (int)Option.LaguageSelect) { Ctrl_Language.StartChange(false); } } else if (down && key == HpyInputKey.BS_Right) { if (mCurCursorIdx == (int)Option.Difficult)//���� { Ctrl_GameDifficul.StartChange(true); } else if (mCurCursorIdx == (int)Option.CoinTicketRatio)//��Ʊ���� { if (mCurrentCoinTicketRotioSelect == null) { mCurrentCoinTicketRotioSelect = Ctrl_CoinTicketRatio_Coin; mCurrentCoinTicketRotioSelect.GetComponent <Ef_RendererFlash>().StartFlash(); } else { mCurrentCoinTicketRotioSelect.GetComponent <Ef_RendererFlash>().StopFlash(); mCurrentCoinTicketRotioSelect.StartChangeNumViewing(1); } mIsMainMenuMovable = false;//���˵������ƶ� } else if (mCurCursorIdx == (int)Option._OutBountyType) { Ctrl_OutBountyType.StartChange(true); } else if (mCurCursorIdx == (int)Option._GunLayoutType) { Ctrl_GunLayouType.StartChange(true); } //else if (mCurCursorIdx == 4) // Ctrl_IsBulletCross.StartChange(true); else if (mCurCursorIdx == (int)Option.ScoreChange) { Ctrl_ScoreChangeVal.StartChangeNumViewing(GetChangeValR); } //else if (mCurCursorIdx == 6) // Ctrl_MinScore.StartChangeNumViewing(GetChangeValR); else if (mCurCursorIdx == (int)Option.MaxGunScore) { Ctrl_MaxScore.StartChangeNumViewing(GetChangeValR); } else if (mCurCursorIdx == (int)Option.LaguageSelect) { Ctrl_Language.StartChange(true); } } else if (down && key == HpyInputKey.BS_Confirm) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } if (mCurCursorIdx == (int)Option.CoinTicketRatio)//��Ʊ���� { if (mCurrentCoinTicketRotioSelect == null) { mCurrentCoinTicketRotioSelect = Ctrl_CoinTicketRatio_Coin; mCurrentCoinTicketRotioSelect.GetComponent <Ef_RendererFlash>().StartFlash(); mIsMainMenuMovable = false; } else { mCurrentCoinTicketRotioSelect.GetComponent <Ef_RendererFlash>().StopFlash(); mCurrentCoinTicketRotioSelect = null; mIsMainMenuMovable = true; } } else if (mCurCursorIdx == (int)Option.RecoverSetting)//�ָ�Ĭ��ֵ { Ctrl_GameDifficul.ViewIdx = (int)BackStageSetting.Def_GameDifficult; Ctrl_CoinTicketRatio_Coin.NumViewing = BackStageSetting.Def_CoinTicketRatio_Coin; Ctrl_CoinTicketRatio_Ticket.NumViewing = BackStageSetting.Def_CoinTicketRatio_Ticket; //Ctrl_IsBulletCross.ViewIdx = BackStageSetting.Def_IsBulletCrossWhenScreenNet ? 1 : 0; Ctrl_ScoreChangeVal.NumViewing = BackStageSetting.Def_ScoreChangeValue; Ctrl_MaxScore.NumViewing = BackStageSetting.Def_ScoreMax; //Ctrl_MinScore.NumViewing = BackStageSetting.Def_ScoreMin; Ctrl_OutBountyType.ViewIdx = (int)BackStageSetting.Def_OutBountyType; Ctrl_GunLayouType.ViewIdx = (int)BackStageSetting.Def_GunLayoutType; Ctrl_Language.ViewIdx = (int)BackStageSetting.Def_LanguageUsing; } else if (mCurCursorIdx == (int)Option.SaveSetting)//�����˳� { //���� �Ѷ� �� ��Ʊ �����Ƿ��иı�,�еĻ�����Ҫ������0 ,�����˳� bool needCodePrint = false; //���� BackStageSetting bsSetting = GameMain.Singleton.BSSetting; if ((int)mEnterVal_GameDifficult != Ctrl_GameDifficul.ViewIdx) { bsSetting.GameDifficult_.Val = (GameDifficult)Ctrl_GameDifficul.ViewIdx; needCodePrint = true; } if (mEnterVal_CoinTicketRatio_Coin != Ctrl_CoinTicketRatio_Coin.NumViewing) { bsSetting.CoinTicketRatio_Coin.Val = Ctrl_CoinTicketRatio_Coin.NumViewing; needCodePrint = true; } if (mEnterVal_CoinTicketRatio_Ticket != Ctrl_CoinTicketRatio_Ticket.NumViewing) { bsSetting.CoinTicketRatio_Ticket.Val = Ctrl_CoinTicketRatio_Ticket.NumViewing; needCodePrint = true; } //if ((mEnterVal_IsBulletCross?1:0) != Ctrl_IsBulletCross.ViewIdx) //{ // bsSetting.IsBulletCrossWhenScreenNet.Val = Ctrl_IsBulletCross.ViewIdx == 1 ? true : false; //} if (mEnterVal_ScoreChangeValue != Ctrl_ScoreChangeVal.NumViewing) { bsSetting.ScoreChangeValue.Val = Ctrl_ScoreChangeVal.NumViewing; bsSetting.ScoreMin.Val = Ctrl_ScoreChangeVal.NumViewing; } if (mEnterVal_Scoremax != Ctrl_MaxScore.NumViewing) { bsSetting.ScoreMax.Val = Ctrl_MaxScore.NumViewing; } //if (mEnterVal_Scoremin != Ctrl_MinScore.NumViewing) //{ // bsSetting.ScoreMin.Val = Ctrl_MinScore.NumViewing; //} if ((int)mEnterVal_OutBountyType != Ctrl_OutBountyType.ViewIdx) { bsSetting.OutBountyType_.Val = (OutBountyType)Ctrl_OutBountyType.ViewIdx; } if ((int)mEnterVal_GunLayoutType != Ctrl_GunLayouType.ViewIdx) { bsSetting.GunLayoutType_.Val = (GunLayoutType)Ctrl_GunLayouType.ViewIdx; } if ((int)mEnterVal_Language != Ctrl_Language.ViewIdx) { bsSetting.LaguageUsing.Val = (Language)Ctrl_Language.ViewIdx; if (GameMain.EvtLanguageChange != null) { GameMain.EvtLanguageChange(bsSetting.LaguageUsing.Val); } } if (needCodePrint) { gameObject.SetActiveRecursively(false); GameMain.Singleton.BSSetting.CodePrintCurrentAction.SetImmdiately(false);//��0״̬ GameMain.Singleton.BSSetting.IsCodePrintClearAllData.SetImmdiately(true); //BackstageMain.Singleton.WndCodePrint.gameObject.SetActiveRecursively(true); BackstageMain.Singleton.WndCodePrint.Enter(); } else { BackToMainMenu(); } } else if (mCurCursorIdx == (int)Option.Quit)//�������˳� { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } BackToMainMenu(); } } #endregion #region keyup if (!down && key == HpyInputKey.BS_Up) { //StopCoroutine("_Coro_SelectPrev"); } else if (!down && key == HpyInputKey.BS_Down) { //StopCoroutine("_Coro_SelectNext"); } else if (!down && key == HpyInputKey.BS_Left) { if (mCurCursorIdx == (int)Option.Difficult) { Ctrl_GameDifficul.StopChange(); } if (mCurCursorIdx == (int)Option.CoinTicketRatio) { if (mCurrentCoinTicketRotioSelect != null) { mCurrentCoinTicketRotioSelect.StopChangeNumViewing(); mCurrentCoinTicketRotioSelect.GetComponent <Ef_RendererFlash>().StartFlash(); } } else if (mCurCursorIdx == (int)Option._OutBountyType) { Ctrl_OutBountyType.StopChange(); } else if (mCurCursorIdx == (int)Option._GunLayoutType) { Ctrl_GunLayouType.StopChange(); } //else if (mCurCursorIdx == 4) // Ctrl_IsBulletCross.StopChange(); else if (mCurCursorIdx == (int)Option.ScoreChange) { Ctrl_ScoreChangeVal.StopChangeNumViewing(); } //else if (mCurCursorIdx == 6) // Ctrl_MinScore.StopChangeNumViewing(); else if (mCurCursorIdx == (int)Option.MaxGunScore) { Ctrl_MaxScore.StopChangeNumViewing(); } else if (mCurCursorIdx == (int)Option.LaguageSelect) { Ctrl_Language.StopChange(); } } else if (!down && key == HpyInputKey.BS_Right) { if (mCurCursorIdx == (int)Option.Difficult) { Ctrl_GameDifficul.StopChange(); } if (mCurCursorIdx == (int)Option.CoinTicketRatio) { if (mCurrentCoinTicketRotioSelect != null) { mCurrentCoinTicketRotioSelect.StopChangeNumViewing(); mCurrentCoinTicketRotioSelect.GetComponent <Ef_RendererFlash>().StartFlash(); } } else if (mCurCursorIdx == (int)Option._OutBountyType) { Ctrl_OutBountyType.StopChange(); } else if (mCurCursorIdx == (int)Option._GunLayoutType) { Ctrl_GunLayouType.StopChange(); } //else if (mCurCursorIdx == 4) // Ctrl_IsBulletCross.StopChange(); else if (mCurCursorIdx == (int)Option.ScoreChange) { Ctrl_ScoreChangeVal.StopChangeNumViewing(); } //else if (mCurCursorIdx == 6) // Ctrl_MinScore.StopChangeNumViewing(); else if (mCurCursorIdx == (int)Option.MaxGunScore) { Ctrl_MaxScore.StopChangeNumViewing(); } else if (mCurCursorIdx == (int)Option.LaguageSelect) { Ctrl_Language.StopChange(); } } #endregion }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Up && mIsCursorMovable) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } else if (!down && key == HpyInputKey.BS_Up && mIsCursorMovable) { //StopCoroutine("_Coro_SelectPrev"); } else if (down && key == HpyInputKey.BS_Down && mIsCursorMovable) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } else if (!down && key == HpyInputKey.BS_Down && mIsCursorMovable) { //StopCoroutine("_Coro_SelectNext"); } else if (down && key == HpyInputKey.BS_Confirm) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); if (mCurCursorIdx == 0) { if (!Box_Decoder.gameObject.active) { mIsCursorMovable = false; //���û����� Box_Decoder.Text_TableNum.text = string.Format("{0:d" + BackStageSetting.Digit_IdTable + "}", GameMain.Singleton.BSSetting.Dat_IdTable.Val); Box_Decoder.Text_TableNum.Commit(); mCurTagId = //34169208; HF_Decoder.GenerateTagCode((uint)GameMain.Singleton.BSSetting.Dat_IdTable.Val , (uint)GameMain.Singleton.BSSetting.Dat_IdLine.Val , (uint)GameMain.Singleton.BSSetting.Dat_FormulaCode.Val, (uint)GameMain.GameIdx); //���������� Box_Decoder.Text_DecodeFeatureNum.text = string.Format("{0:d8}", mCurTagId);// mCurTagId.ToString(); Box_Decoder.Text_DecodeFeatureNum.Commit(); Box_Decoder.gameObject.SetActiveRecursively(true); } } else if (mCurCursorIdx == 1) { BackToMainMenu(); } } else if (down && key == HpyInputKey.BS_Cancel) { if (mCurCursorIdx == 0) { mIsCursorMovable = true; Box_Decoder.gameObject.SetActiveRecursively(false); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } }
void Handle_Input(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Up) { if (mIsEditing) { //mDigits[mIdxCursor] = (mDigits[mIdxCursor] + 1) % 10; StopCoroutine("_Coro_ChangeCurrentCursorDigit"); StartCoroutine("_Coro_ChangeCurrentCursorDigit", new KeyValuePair <int, float>(1, 0F)); mChangeIdxCursorAble = false; } else { //�ж��Ƿ��Ѿ��༭�� if (mIdxCursor == mNumEdited)//���µ�λ�� { mDigits[mIdxCursor] = 0; if (mNumEdited < mNum) { ++mNumEdited; } } mIsEditing = true; StopCoroutine("_Coro_ChangeCurrentCursorDigit"); StartCoroutine("_Coro_ChangeCurrentCursorDigit", new KeyValuePair <int, float>(1, 0.5F)); mChangeIdxCursorAble = false; } UpdateCursor(); } else if (down && key == HpyInputKey.BS_Down) { if (mIsEditing) { //--mDigits[mIdxCursor]; //if (mDigits[mIdxCursor] < 0) // mDigits[mIdxCursor] = 9; StopCoroutine("_Coro_ChangeCurrentCursorDigit"); StartCoroutine("_Coro_ChangeCurrentCursorDigit", new KeyValuePair <int, float>(-1, 0)); mChangeIdxCursorAble = false; } else { //�ж��Ƿ��Ѿ��༭�� if (mIdxCursor == mNumEdited)//���µ�λ�� { mDigits[mIdxCursor] = 9; if (mNumEdited < mNum) { ++mNumEdited; } } mIsEditing = true; StopCoroutine("_Coro_ChangeCurrentCursorDigit"); StartCoroutine("_Coro_ChangeCurrentCursorDigit", new KeyValuePair <int, float>(-1, 0.5F)); mChangeIdxCursorAble = false; } UpdateCursor(); } else if (down && key == HpyInputKey.BS_Left && mChangeIdxCursorAble) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } if (mIdxCursor > 0) { --mIdxCursor; } if (mIsEditing) { mIsEditing = false; } UpdateCursor(); } else if (down && key == HpyInputKey.BS_Right && mChangeIdxCursorAble) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } if (mIdxCursor < mNumEdited && mIdxCursor + 1 != mNum) { ++mIdxCursor; } if (mIsEditing) { mIsEditing = false; } UpdateCursor(); } else if (down && key == HpyInputKey.BS_Confirm) { if (mNumEdited == mNum) { if (EvtConfirm != null) { EvtConfirm(mDigits); } //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } } //���𰴼�////////////////////////////////////////////////////////////////// if (!down && key == HpyInputKey.BS_Up) { if (mIsEditing) { StopCoroutine("_Coro_ChangeCurrentCursorDigit"); mChangeIdxCursorAble = true; } } else if (!down && key == HpyInputKey.BS_Down) { if (mIsEditing) { StopCoroutine("_Coro_ChangeCurrentCursorDigit"); mChangeIdxCursorAble = true; } } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (!mControlable) { return; } if (down && key == HpyInputKey.BS_Up) { PrevSelection(); //StartCoroutine("_Coro_PrevSelection"); } else if (down && key == HpyInputKey.BS_Down) { NextSelection(); //StartCoroutine("_Coro_NextSelection"); } //else if (!down && key == HpyInputKey.BS_Up) //{ // StopCoroutine("_Coro_PrevSelection"); //} //else if (!down && key == HpyInputKey.BS_Down) //{ // StopCoroutine("_Coro_NextSelection"); //} else if (down && key == HpyInputKey.BS_Confirm) { //音效-后台 if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } if (mCurCursorIdx == 0)//参数设置 { mBsMain.WndMainMenu.gameObject.SetActiveRecursively(false); mBsMain.WndParamSetting.SetActiveRecursively(true); } else if (mCurCursorIdx == 1)//解码调整 { mBsMain.WndMainMenu.gameObject.SetActiveRecursively(false); mBsMain.WndDecodeSetting.gameObject.SetActiveRecursively(true); } else if (mCurCursorIdx == 2)//查账 { mBsMain.WndMainMenu.gameObject.SetActiveRecursively(false); mBsMain.WndCheckBill.gameObject.SetActiveRecursively(true); } else if (mCurCursorIdx == 3) //报账 { mBsMain.Ctrl_CodePrintConfirm.SelectIdx = 1; //出现在否处 mBsMain.Ctrl_CodePrintConfirm.gameObject.SetActiveRecursively(true); //确认框 mControlable = false; } else if (mCurCursorIdx == 4)//系统设置 { mBsMain.Ctrl_SystemSettingPswInput.gameObject.SetActiveRecursively(true); mControlable = false; } else if (mCurCursorIdx == 5)//退出 { mBsMain.WndMainMenu.gameObject.SetActiveRecursively(false); mBsMain.WndReboot.gameObject.SetActiveRecursively(true); mBsMain.Cursor.gameObject.SetActiveRecursively(false); } } }
/// <summary> /// ��������,��GameMain���� /// </summary> /// <param name="p"></param> /// <param name="k"></param> /// <param name="down"></param> public void OnKeyDown(HpyInputKey k, bool down) { if (down && k == HpyInputKey.Left) { mLeftRightKeystate[0] = true; goto tag_GunRotate; } else if (!down && k == HpyInputKey.Left) { mLeftRightKeystate[0] = false; goto tag_GunRotate; } else if (down && k == HpyInputKey.Right) { mLeftRightKeystate[1] = true; goto tag_GunRotate; } else if (!down && k == HpyInputKey.Right) { mLeftRightKeystate[1] = false; goto tag_GunRotate; } //else if (down && k == HpyInputKey.Down) //{ // if (mFishLocker != null) // { // Fish f = mFishLocker.Lock(); // if (f != null) // GunInst.LockAt(f); // } //} //else if (!down && k == HpyInputKey.Down) //{ // if (mFishLocker != null) // { // mFishLocker.UnLock(); // GunInst.UnLock(); // } //} else if (down && k == HpyInputKey.Fire) { GunInst.StartFire(); } else if (!down && k == HpyInputKey.Fire) { GunInst.StopNormalFire(); } else if (down && k == HpyInputKey.Advance) { //GunInst.StartChangeNeedCoin(); StartCoroutine("_Coro_ChangeNeedScore"); } else if (!down && k == HpyInputKey.Advance) { //GunInst.StopChangeNeedCoin(); StopCoroutine("_Coro_ChangeNeedScore"); } else if (down && k == HpyInputKey.ScoreUp) { StartCoroutine("_Coro_ScoreBatchUp"); mIsUpScoreBatch = false; } else if (!down && k == HpyInputKey.ScoreUp) { StopCoroutine("_Coro_ScoreBatchUp"); if (!mIsUpScoreBatch) { ScoreUp(false); } } else if (down && k == HpyInputKey.ScoreDown) { StartCoroutine("_Coro_ScoreBatchDown"); mIsDownScoreBatch = false; } else if (!down && k == HpyInputKey.ScoreDown) { StopCoroutine("_Coro_ScoreBatchDown"); if (!mIsDownScoreBatch) { ScoreDown(false); } } return; tag_GunRotate: if (mLeftRightKeystate[0] && mLeftRightKeystate[1]) GunInst.StopRotate(); else if (!mLeftRightKeystate[0] && !mLeftRightKeystate[1]) GunInst.StopRotate(); else if (mLeftRightKeystate[0]) GunInst.RotateTo(true); else if (mLeftRightKeystate[1]) GunInst.RotateTo(false); }
void HandleBackGroundKeyEvent(int control, HpyInputKey key,bool down) { //����Ϸ�� if (GameMain.Singleton.IsInBackstage) return; if (down && key == HpyInputKey.BS_Left) StartCoroutine("_Coro_ChangeVol", -1); else if (down && key == HpyInputKey.BS_Right) StartCoroutine("_Coro_ChangeVol", 1); else if (!down && key == HpyInputKey.BS_Left) StopCoroutine("_Coro_ChangeVol"); else if (!down && key == HpyInputKey.BS_Right) StopCoroutine("_Coro_ChangeVol"); }
void Update() { if (mDirectCtrlling) { if (DirectContrller.Strength > 0.5F) { float currentAngle = -AngleDir(Vector3.up, DirectContrller.Direction, Vector3.forward) * Vector3.Angle(Vector3.up, DirectContrller.Direction); HpyInputKey curDirectState = HpyInputKey.BS_GameLite; currentAngle = (currentAngle + 360F) % 360F; //Debug.Log(currentAngle); if (currentAngle > 315F && currentAngle <= 45F) { curDirectState = HpyInputKey.Up; } else if (currentAngle > 45F && currentAngle <= 135F) { curDirectState = HpyInputKey.Right; } else if (currentAngle > 135F && currentAngle <= 225F) { curDirectState = HpyInputKey.Down; } else if (currentAngle > 225F && currentAngle <= 315F) { curDirectState = HpyInputKey.Left; } else { curDirectState = HpyInputKey.BS_GameLite; } if (mPreDirectState != curDirectState) { if (mPreDirectState != HpyInputKey.BS_GameLite) { GameMain.EvtInputKey(0, mPreDirectState, false); } if (curDirectState != HpyInputKey.BS_GameLite) { GameMain.EvtInputKey(0, curDirectState, true); } } mPreDirectState = curDirectState; //Debug.Log(AngleDir(Vector3.up,DirectContrller.Direction,Vector3.forward)*Vector3.Angle(Vector3.up, DirectContrller.Direction)); } else//��Ȩ�� { if (mPreDirectState != HpyInputKey.BS_GameLite) { GameMain.EvtInputKey(0, mPreDirectState, false); mPreDirectState = HpyInputKey.BS_GameLite; } } } }
void Handle_Input(int control, HpyInputKey key, bool down) { if (key == HpyInputKey.BS_Cancel && down) { if (mCurNumInputer != null) { Destroy(mCurNumInputer.gameObject); mCurNumInputer = null; mCurWndOptioner.IsControlable = true; } } else if ((key == HpyInputKey.BS_Left||key == HpyInputKey.BS_Right) && down) { if (mCurSelectIdx == 4) { Transform ts = mCurWndOptioner.transform.FindChild("option4/ctrl_��ǰ��ʾ״̬"); Ctrl_OptionText ctrlOption = null; if(ts!=null) ctrlOption = ts.GetComponent<Ctrl_OptionText>(); if (ctrlOption != null) { PersistentData<bool,bool> isShowLanguageSetup = GameMain.Singleton.BSSetting.Dat_GameShowLanguageSetup; isShowLanguageSetup.Val = !isShowLanguageSetup.Val; ctrlOption.ViewIdx = isShowLanguageSetup.Val ? 0 : 1; ctrlOption.UpdateText(); } else { Debug.LogError("ctrlOption == null"); } } } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Up && mIsCursorMovable) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } else if (!down && key == HpyInputKey.BS_Up && mIsCursorMovable) { //StopCoroutine("_Coro_SelectPrev"); } else if (down && key == HpyInputKey.BS_Down && mIsCursorMovable) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } else if (!down && key == HpyInputKey.BS_Down && mIsCursorMovable) { //StopCoroutine("_Coro_SelectNext"); } else if (down && key == HpyInputKey.BS_Confirm) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } if (mCurCursorIdx == 0) { if (!Box_Decoder.gameObject.active) { mIsCursorMovable = false; //���û����� Box_Decoder.Text_TableNum.text = string.Format("{0:d" + BackStageSetting.Digit_IdTable + "}", GameMain.Singleton.BSSetting.Dat_IdTable.Val); Box_Decoder.Text_TableNum.Commit(); mCurTagId = //34169208; HF_Decoder.GenerateTagCode((uint)GameMain.Singleton.BSSetting.Dat_IdTable.Val , (uint)GameMain.Singleton.BSSetting.Dat_IdLine.Val , (uint)GameMain.Singleton.BSSetting.Dat_FormulaCode.Val, (uint)GameMain.GameIdx); //���������� Box_Decoder.Text_DecodeFeatureNum.text = string.Format("{0:d8}", mCurTagId);// mCurTagId.ToString(); Box_Decoder.Text_DecodeFeatureNum.Commit(); Box_Decoder.gameObject.SetActiveRecursively(true); } } else if (mCurCursorIdx == 1) { BackToMainMenu(); } } else if (down && key == HpyInputKey.BS_Cancel) { if (mCurCursorIdx == 0) { mIsCursorMovable = true; Box_Decoder.gameObject.SetActiveRecursively(false); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) { GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } } }
/// <summary> /// 按键按下,有GameMain触发 /// </summary> /// <param name="p"></param> /// <param name="k"></param> /// <param name="down"></param> public void OnKeyDown(HpyInputKey k, bool down) { if (down && k == HpyInputKey.Left) { mLeftRightKeystate[0] = true; goto tag_GunRotate; } else if (!down && k == HpyInputKey.Left) { mLeftRightKeystate[0] = false; goto tag_GunRotate; } else if (down && k == HpyInputKey.Right) { mLeftRightKeystate[1] = true; goto tag_GunRotate; } else if (!down && k == HpyInputKey.Right) { mLeftRightKeystate[1] = false; goto tag_GunRotate; } //else if (down && k == HpyInputKey.Down) //{ // if (mFishLocker != null) // { // Fish f = mFishLocker.Lock(); // if (f != null) // GunInst.LockAt(f); // } //} //else if (!down && k == HpyInputKey.Down) //{ // if (mFishLocker != null) // { // mFishLocker.UnLock(); // GunInst.UnLock(); // } //} else if (down && k == HpyInputKey.Fire) { GunInst.StartFire(); } else if (!down && k == HpyInputKey.Fire) { GunInst.StopNormalFire(); } else if (down && k == HpyInputKey.Advance) { //GunInst.StartChangeNeedCoin(); StartCoroutine("_Coro_ChangeNeedScore"); } else if (!down && k == HpyInputKey.Advance) { //GunInst.StopChangeNeedCoin(); StopCoroutine("_Coro_ChangeNeedScore"); } else if (down && k == HpyInputKey.ScoreUp) { StartCoroutine("_Coro_ScoreBatchUp"); mIsUpScoreBatch = false; } else if (!down && k == HpyInputKey.ScoreUp) { StopCoroutine("_Coro_ScoreBatchUp"); if (!mIsUpScoreBatch) { ScoreUp(false); } } else if (down && k == HpyInputKey.ScoreDown) { StartCoroutine("_Coro_ScoreBatchDown"); mIsDownScoreBatch = false; } else if (!down && k == HpyInputKey.ScoreDown) { StopCoroutine("_Coro_ScoreBatchDown"); if (!mIsDownScoreBatch) { ScoreDown(false); } } return; tag_GunRotate: if (mLeftRightKeystate[0] && mLeftRightKeystate[1]) { GunInst.StopRotate(); } else if (!mLeftRightKeystate[0] && !mLeftRightKeystate[1]) { GunInst.StopRotate(); } else if (mLeftRightKeystate[0]) { GunInst.RotateTo(true); } else if (mLeftRightKeystate[1]) { GunInst.RotateTo(false); } }
void Handle_InputKey(int control, HpyInputKey key,bool down) { if (!mControlable) return; if(down && key == HpyInputKey.BS_Up) { PrevSelection(); //StartCoroutine("_Coro_PrevSelection"); } else if (down && key == HpyInputKey.BS_Down) { NextSelection(); //StartCoroutine("_Coro_NextSelection"); } //else if (!down && key == HpyInputKey.BS_Up) //{ // StopCoroutine("_Coro_PrevSelection"); //} //else if (!down && key == HpyInputKey.BS_Down) //{ // StopCoroutine("_Coro_NextSelection"); //} else if (down && key == HpyInputKey.BS_Confirm) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); if (mCurCursorIdx == 0)//�������� { mBsMain.WndMainMenu.gameObject.SetActiveRecursively(false); mBsMain.WndParamSetting.SetActiveRecursively(true); } else if (mCurCursorIdx == 1)//������� { mBsMain.WndMainMenu.gameObject.SetActiveRecursively(false); mBsMain.WndDecodeSetting.gameObject.SetActiveRecursively(true); } else if (mCurCursorIdx == 2)//���� { mBsMain.WndMainMenu.gameObject.SetActiveRecursively(false); mBsMain.WndCheckBill.gameObject.SetActiveRecursively(true); } else if (mCurCursorIdx == 3)//���� { mBsMain.Ctrl_CodePrintConfirm.SelectIdx = 1;//�����ڷ� mBsMain.Ctrl_CodePrintConfirm.gameObject.SetActiveRecursively(true);//ȷ�Ͽ� mControlable = false; } else if (mCurCursorIdx == 4)//ϵͳ���� { mBsMain.Ctrl_SystemSettingPswInput.gameObject.SetActiveRecursively(true); mControlable = false; } else if (mCurCursorIdx == 5)//�˳� { mBsMain.WndMainMenu.gameObject.SetActiveRecursively(false); mBsMain.WndReboot.gameObject.SetActiveRecursively(true); mBsMain.Cursor.gameObject.SetActiveRecursively(false); } } }
void Handle_Input(int control, HpyInputKey key, bool down) { if (down && key == HpyInputKey.BS_Up) { if (mIsEditing) { //mDigits[mIdxCursor] = (mDigits[mIdxCursor] + 1) % 10; StopCoroutine("_Coro_ChangeCurrentCursorDigit"); StartCoroutine("_Coro_ChangeCurrentCursorDigit", new KeyValuePair<int,float>(1,0F)); mChangeIdxCursorAble = false; } else { //�ж��Ƿ��Ѿ��༭�� if (mIdxCursor == mNumEdited)//���µ�λ�� { mDigits[mIdxCursor] = 0; if (mNumEdited < mNum) ++mNumEdited; } mIsEditing = true; StopCoroutine("_Coro_ChangeCurrentCursorDigit"); StartCoroutine("_Coro_ChangeCurrentCursorDigit", new KeyValuePair<int, float>(1, 0.5F)); mChangeIdxCursorAble = false; } UpdateCursor(); } else if (down && key == HpyInputKey.BS_Down) { if (mIsEditing) { //--mDigits[mIdxCursor]; //if (mDigits[mIdxCursor] < 0) // mDigits[mIdxCursor] = 9; StopCoroutine("_Coro_ChangeCurrentCursorDigit"); StartCoroutine("_Coro_ChangeCurrentCursorDigit", new KeyValuePair<int, float>(-1, 0)); mChangeIdxCursorAble = false; } else { //�ж��Ƿ��Ѿ��༭�� if (mIdxCursor == mNumEdited)//���µ�λ�� { mDigits[mIdxCursor] = 9; if (mNumEdited < mNum) ++mNumEdited; } mIsEditing = true; StopCoroutine("_Coro_ChangeCurrentCursorDigit"); StartCoroutine("_Coro_ChangeCurrentCursorDigit", new KeyValuePair<int, float>(-1, 0.5F)); mChangeIdxCursorAble = false; } UpdateCursor(); } else if (down && key == HpyInputKey.BS_Left && mChangeIdxCursorAble ) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); if (mIdxCursor > 0) --mIdxCursor; if (mIsEditing) { mIsEditing = false; } UpdateCursor(); } else if (down && key == HpyInputKey.BS_Right && mChangeIdxCursorAble) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); if (mIdxCursor < mNumEdited && mIdxCursor +1 != mNum) ++mIdxCursor; if (mIsEditing) { mIsEditing = false; } UpdateCursor(); } else if (down && key == HpyInputKey.BS_Confirm) { if (mNumEdited == mNum) { if (EvtConfirm != null) EvtConfirm(mDigits); //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); } } //���𰴼�////////////////////////////////////////////////////////////////// if (!down && key == HpyInputKey.BS_Up) { if (mIsEditing) { StopCoroutine("_Coro_ChangeCurrentCursorDigit"); mChangeIdxCursorAble = true; } } else if (!down && key == HpyInputKey.BS_Down) { if (mIsEditing) { StopCoroutine("_Coro_ChangeCurrentCursorDigit"); mChangeIdxCursorAble = true; } } }
void Handle_InputKey(int control, HpyInputKey key, bool down) { #region keydown if (down && key == HpyInputKey.BS_Up) { SelectPrev(); //StartCoroutine("_Coro_SelectPrev"); } else if (down && key == HpyInputKey.BS_Down) { SelectNext(); //StartCoroutine("_Coro_SelectNext"); } else if (down && key == HpyInputKey.BS_Left) { if (mCurCursorIdx == (int)Option.Difficult)//���� { Ctrl_GameDifficul.StartChange(false); } else if (mCurCursorIdx == (int)Option.CoinTicketRatio)//��Ʊ���� { if (mCurrentCoinTicketRotioSelect == null) { mCurrentCoinTicketRotioSelect = Ctrl_CoinTicketRatio_Coin; mCurrentCoinTicketRotioSelect.GetComponent<Ef_RendererFlash>().StartFlash(); } else { mCurrentCoinTicketRotioSelect.GetComponent<Ef_RendererFlash>().StopFlash(); mCurrentCoinTicketRotioSelect.StartChangeNumViewing(-1); } mIsMainMenuMovable = false;//���˵������ƶ� } else if (mCurCursorIdx == (int)Option._OutBountyType) Ctrl_OutBountyType.StartChange(false); else if (mCurCursorIdx == (int)Option._GunLayoutType) Ctrl_GunLayouType.StartChange(false); //else if (mCurCursorIdx == 4) // Ctrl_IsBulletCross.StartChange(false); else if (mCurCursorIdx == (int)Option.ScoreChange) Ctrl_ScoreChangeVal.StartChangeNumViewing((int cur) => { return -GetChangeValL(cur); }); //else if (mCurCursorIdx == 6) // Ctrl_MinScore.StartChangeNumViewing((int cur) => { return -GetChangeValL(cur); }); else if (mCurCursorIdx == (int)Option.MaxGunScore) Ctrl_MaxScore.StartChangeNumViewing((int cur) => { return -GetChangeValL(cur); }); else if (mCurCursorIdx == (int)Option.LaguageSelect) Ctrl_Language.StartChange(false); } else if (down && key == HpyInputKey.BS_Right) { if (mCurCursorIdx == (int)Option.Difficult)//���� { Ctrl_GameDifficul.StartChange(true); } else if (mCurCursorIdx == (int)Option.CoinTicketRatio)//��Ʊ���� { if (mCurrentCoinTicketRotioSelect == null) { mCurrentCoinTicketRotioSelect = Ctrl_CoinTicketRatio_Coin; mCurrentCoinTicketRotioSelect.GetComponent<Ef_RendererFlash>().StartFlash(); } else { mCurrentCoinTicketRotioSelect.GetComponent<Ef_RendererFlash>().StopFlash(); mCurrentCoinTicketRotioSelect.StartChangeNumViewing(1); } mIsMainMenuMovable = false;//���˵������ƶ� } else if (mCurCursorIdx == (int)Option._OutBountyType) Ctrl_OutBountyType.StartChange(true); else if (mCurCursorIdx == (int)Option._GunLayoutType) Ctrl_GunLayouType.StartChange(true); //else if (mCurCursorIdx == 4) // Ctrl_IsBulletCross.StartChange(true); else if (mCurCursorIdx == (int)Option.ScoreChange) Ctrl_ScoreChangeVal.StartChangeNumViewing(GetChangeValR); //else if (mCurCursorIdx == 6) // Ctrl_MinScore.StartChangeNumViewing(GetChangeValR); else if (mCurCursorIdx == (int)Option.MaxGunScore) Ctrl_MaxScore.StartChangeNumViewing(GetChangeValR); else if (mCurCursorIdx == (int)Option.LaguageSelect) Ctrl_Language.StartChange(true); } else if (down && key == HpyInputKey.BS_Confirm) { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); if (mCurCursorIdx == (int)Option.CoinTicketRatio)//��Ʊ���� { if (mCurrentCoinTicketRotioSelect == null) { mCurrentCoinTicketRotioSelect = Ctrl_CoinTicketRatio_Coin; mCurrentCoinTicketRotioSelect.GetComponent<Ef_RendererFlash>().StartFlash(); mIsMainMenuMovable = false; } else { mCurrentCoinTicketRotioSelect.GetComponent<Ef_RendererFlash>().StopFlash(); mCurrentCoinTicketRotioSelect = null; mIsMainMenuMovable = true; } } else if (mCurCursorIdx == (int)Option.RecoverSetting)//�ָ�Ĭ��ֵ { Ctrl_GameDifficul.ViewIdx = (int)BackStageSetting.Def_GameDifficult; Ctrl_CoinTicketRatio_Coin.NumViewing = BackStageSetting.Def_CoinTicketRatio_Coin; Ctrl_CoinTicketRatio_Ticket.NumViewing = BackStageSetting.Def_CoinTicketRatio_Ticket; //Ctrl_IsBulletCross.ViewIdx = BackStageSetting.Def_IsBulletCrossWhenScreenNet ? 1 : 0; Ctrl_ScoreChangeVal.NumViewing = BackStageSetting.Def_ScoreChangeValue; Ctrl_MaxScore.NumViewing = BackStageSetting.Def_ScoreMax; //Ctrl_MinScore.NumViewing = BackStageSetting.Def_ScoreMin; Ctrl_OutBountyType.ViewIdx = (int)BackStageSetting.Def_OutBountyType; Ctrl_GunLayouType.ViewIdx = (int)BackStageSetting.Def_GunLayoutType; Ctrl_Language.ViewIdx = (int)BackStageSetting.Def_LanguageUsing; } else if (mCurCursorIdx == (int)Option.SaveSetting)//�����˳� { //��� �Ѷ� �� ��Ʊ �����Ƿ��иı�,�еĻ�����Ҫ������0 ,�����˳� bool needCodePrint = false; //���� BackStageSetting bsSetting = GameMain.Singleton.BSSetting; if ((int)mEnterVal_GameDifficult != Ctrl_GameDifficul.ViewIdx) { bsSetting.GameDifficult_.Val = (GameDifficult)Ctrl_GameDifficul.ViewIdx; needCodePrint = true; } if (mEnterVal_CoinTicketRatio_Coin != Ctrl_CoinTicketRatio_Coin.NumViewing) { bsSetting.CoinTicketRatio_Coin.Val = Ctrl_CoinTicketRatio_Coin.NumViewing; needCodePrint = true; } if (mEnterVal_CoinTicketRatio_Ticket != Ctrl_CoinTicketRatio_Ticket.NumViewing) { bsSetting.CoinTicketRatio_Ticket.Val = Ctrl_CoinTicketRatio_Ticket.NumViewing; needCodePrint = true; } //if ((mEnterVal_IsBulletCross?1:0) != Ctrl_IsBulletCross.ViewIdx) //{ // bsSetting.IsBulletCrossWhenScreenNet.Val = Ctrl_IsBulletCross.ViewIdx == 1 ? true : false; //} if (mEnterVal_ScoreChangeValue != Ctrl_ScoreChangeVal.NumViewing) { bsSetting.ScoreChangeValue.Val = Ctrl_ScoreChangeVal.NumViewing; bsSetting.ScoreMin.Val = Ctrl_ScoreChangeVal.NumViewing; } if (mEnterVal_Scoremax != Ctrl_MaxScore.NumViewing) { bsSetting.ScoreMax.Val = Ctrl_MaxScore.NumViewing; } //if (mEnterVal_Scoremin != Ctrl_MinScore.NumViewing) //{ // bsSetting.ScoreMin.Val = Ctrl_MinScore.NumViewing; //} if ((int)mEnterVal_OutBountyType != Ctrl_OutBountyType.ViewIdx) { bsSetting.OutBountyType_.Val = (OutBountyType)Ctrl_OutBountyType.ViewIdx; } if((int)mEnterVal_GunLayoutType != Ctrl_GunLayouType.ViewIdx) { bsSetting.GunLayoutType_.Val = (GunLayoutType)Ctrl_GunLayouType.ViewIdx; } if ((int)mEnterVal_Language != Ctrl_Language.ViewIdx) { bsSetting.LaguageUsing.Val = (Language)Ctrl_Language.ViewIdx; if (GameMain.EvtLanguageChange != null) GameMain.EvtLanguageChange(bsSetting.LaguageUsing.Val); } if (needCodePrint) { gameObject.SetActiveRecursively(false); GameMain.Singleton.BSSetting.CodePrintCurrentAction.SetImmdiately(false);//��0״̬ GameMain.Singleton.BSSetting.IsCodePrintClearAllData.SetImmdiately(true); //BackstageMain.Singleton.WndCodePrint.gameObject.SetActiveRecursively(true); BackstageMain.Singleton.WndCodePrint.Enter(); } else BackToMainMenu(); } else if (mCurCursorIdx == (int)Option.Quit)//�������˳� { //��Ч-��̨ if (GameMain.Singleton.SoundMgr.snd_bkBtn != null) GameMain.Singleton.SoundMgr.PlayOneShot(GameMain.Singleton.SoundMgr.snd_bkBtn); BackToMainMenu(); } } #endregion #region keyup if (!down && key == HpyInputKey.BS_Up) { //StopCoroutine("_Coro_SelectPrev"); } else if (!down && key == HpyInputKey.BS_Down) { //StopCoroutine("_Coro_SelectNext"); } else if (!down && key == HpyInputKey.BS_Left) { if (mCurCursorIdx == (int)Option.Difficult) { Ctrl_GameDifficul.StopChange(); } if (mCurCursorIdx == (int)Option.CoinTicketRatio) { if (mCurrentCoinTicketRotioSelect != null) { mCurrentCoinTicketRotioSelect.StopChangeNumViewing(); mCurrentCoinTicketRotioSelect.GetComponent<Ef_RendererFlash>().StartFlash(); } } else if (mCurCursorIdx == (int)Option._OutBountyType) Ctrl_OutBountyType.StopChange(); else if (mCurCursorIdx == (int)Option._GunLayoutType) Ctrl_GunLayouType.StopChange(); //else if (mCurCursorIdx == 4) // Ctrl_IsBulletCross.StopChange(); else if (mCurCursorIdx == (int)Option.ScoreChange) Ctrl_ScoreChangeVal.StopChangeNumViewing(); //else if (mCurCursorIdx == 6) // Ctrl_MinScore.StopChangeNumViewing(); else if (mCurCursorIdx == (int)Option.MaxGunScore) Ctrl_MaxScore.StopChangeNumViewing(); else if (mCurCursorIdx == (int)Option.LaguageSelect) Ctrl_Language.StopChange(); } else if (!down && key == HpyInputKey.BS_Right) { if (mCurCursorIdx == (int)Option.Difficult) { Ctrl_GameDifficul.StopChange(); } if (mCurCursorIdx == (int)Option.CoinTicketRatio) { if (mCurrentCoinTicketRotioSelect != null) { mCurrentCoinTicketRotioSelect.StopChangeNumViewing(); mCurrentCoinTicketRotioSelect.GetComponent<Ef_RendererFlash>().StartFlash(); } } else if (mCurCursorIdx == (int)Option._OutBountyType) Ctrl_OutBountyType.StopChange(); else if (mCurCursorIdx == (int)Option._GunLayoutType) Ctrl_GunLayouType.StopChange(); //else if (mCurCursorIdx == 4) // Ctrl_IsBulletCross.StopChange(); else if (mCurCursorIdx == (int)Option.ScoreChange) Ctrl_ScoreChangeVal.StopChangeNumViewing(); //else if (mCurCursorIdx == 6) // Ctrl_MinScore.StopChangeNumViewing(); else if (mCurCursorIdx == (int)Option.MaxGunScore) Ctrl_MaxScore.StopChangeNumViewing(); else if (mCurCursorIdx == (int)Option.LaguageSelect) Ctrl_Language.StopChange(); } #endregion }