/// <summary> /// 深度2の設定を変更する関数を制御する /// </summary> private void Setting2() { switch (menu) { case Menu.SOUND: seSprite.Draw(SEvol); seCS.Draw(SEvol); SettingSE(); break; case Menu.BUTTON: magicSprite.Set(magic); SettingMagic(); break; } //上 if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y > 0) { setting = SETTING_1; SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(RESET_KEY); } //下 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y < 0) { setting = SETTING_MENU; SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(RESET_KEY); } }
void keyMoves() { if (KeyLoader.keyLoader.joyStickAxis.x > 0 && !KeyLoader.keyLoader.StickWait) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); meNam += 1; meNam %= me.Length; KeyLoader.keyLoader.SetStickWait(keyWait); ImageSet(); } else if (KeyLoader.keyLoader.joyStickAxis.x < 0 && !KeyLoader.keyLoader.StickWait) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); meNam += me.Length - 1; meNam %= me.Length; KeyLoader.keyLoader.SetStickWait(keyWait); ImageSet(); } else if (KeyLoader.keyLoader.joyStickAxis.x == 0) { KeyLoader.keyLoader.SetStickWait(0); } }
void Explosion() { if (!explosiondd) { explosiondd = true; Instantiate(explosionEfect, enemyCenterPos, new Quaternion(0, 0, 0, 0)); SEMaster.Play(explosionSound); Destroy(gameObject); RaycastHit[] hits; hits = Physics.SphereCastAll(enemyCenterPos, explosionRadius, Vector3.up, 0.001f, LayerMask.GetMask(LayerName.BLOCK, LayerName.ENEMY), QueryTriggerInteraction.Ignore); foreach (RaycastHit hit in hits) { if (hit.transform.CompareTag("blockObj")) { Debug.Log("Explosion name =" + LayerMask.LayerToName(hit.transform.gameObject.layer)); Destroy(hit.transform.gameObject); Instantiate(ef, hit.transform.position, new Quaternion(0, 0, 0, 0)); } else if (hit.transform.GetComponent <Wamonn>() != null) { hit.transform.GetComponent <Wamonn>().Explosion(); } } } }
private void FallHitBlock(GameObject hit) { Instantiate(breakEffect, hit.transform.position, breakEffect.transform.rotation); GetComponent <Rigidbody>().velocity = Vector3.zero; SEMaster.Play(dosundd); Destroy(hit.transform.gameObject); }
/// <summary> /// 球の生成 /// </summary> /// <param name="go">生成する球のプレハブ</param> /// <param name="shotMoveDir">球の移動方向</param> void CreateShot(PlayerShot go, Vector3 shotMoveDir) { playerShot = Instantiate(go); freezeExist = true; playerShot.transform.position = shotCenterPos + transform.position + (shotMoveDir * shotPos); playerShot.moves = shotMoveDir; SEMaster.Play(shotSound); }
private void FallHitWall() { Debug.Log("どっスん"); fall = false; fallOne = true; SEMaster.Play(dosun); Instantiate(ef, transform.position, ef.transform.rotation); }
/// <summary> /// timeの間隔で羽ばたく音を再生する /// </summary> /// <param name="time">羽ばたく音を再生する間隔</param> /// <returns>コルーチン参照</returns> IEnumerator FlapSoundStart(int time) { for (int i = 0; i < time + 1; i++) { yield return(new WaitForFixedUpdate()); } SEMaster.Play(flapSound); StartCoroutine(FlapSoundStart(time)); }
/// <summary> /// 球を生成する /// </summary> private void CreateGameobj() { Vector3 ppos = Player.player.playerCenter; Vector3 tdir = (ppos - (enemyCenterPos)).normalized; SEMaster.Play(shotSound); BookOffShot shotOb = Instantiate(shot, transform.position + (tdir * popPos), new Quaternion(0, 0, 0, 0), transform.parent); shotOb.moves = new Vector2(tdir.x, tdir.y); }
/// <summary> /// ジャンプのキーを変更する関数 /// </summary> private void SettingJump() { //右 if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.x > 0) { //ジャンプのキー変更 if (jump == Menu.B) { jump = Menu.A; } else { jump++; } //ジャンプと魔法が同じ if (jump == magic) { jump++; if (jump > Menu.B) { jump = Menu.A; } } KeyLoader.keyLoader.SetStickWait(RESET_KEY); //カーソル移動音 SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); } //左 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.x < 0) { //ジャンプのキー変更 if (jump == Menu.A) { jump = Menu.B; } else { jump--; } //ジャンプと魔法が同じ if (jump == magic) { jump--; if (jump < Menu.A) { jump = Menu.B; } } KeyLoader.keyLoader.SetStickWait(RESET_KEY); //カーソル移動音 SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); } //変更した値をセーブする SaveData.SaveInt("JumpKey", jump); }
//---ゲームクリア----- /// <summary> /// フロアをすべてクリアした /// </summary> private void FloorAllClear() { GameClearEventStert(); DestoryAnderObj(); EPSystem[floorNamber].TowerEnd(); StageEffect.EffectAllStop(); SEMaster.Play(clearSE); BGMMaster.CangeBGM(clearBGM); towerState = TowerState.GameClearEnd; }
/// <summary> /// メニュー変更 /// </summary> private void SelectMenu() { //右 if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.x > 0) { if (menu == Menu.TITLE) { menu = Menu.CLOSE; } else { menu++; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(RESET_KEY); } //左 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.x < 0) { if (menu == Menu.CLOSE) { menu = Menu.TITLE; } else { menu--; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(RESET_KEY); } //上 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y > 0) { //深度が1までのものは深度1に if (menu == Menu.CLOSE || menu == Menu.TITLE) { setting = SETTING_1; } //深度が2までのものは深度を2にする else { setting = SETTING_2; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(RESET_KEY); } //下 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y < 0) { setting = SETTING_1; SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(RESET_KEY); } }
/// <summary> /// 魔法のキーを変更する関数 /// </summary> private void SettingMagic() { if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.x < 0) { //魔法のキー変更 if (magic == Menu.A) { magic = Menu.B; } else { magic--; } //ジャンプと魔法が同じ if (jump == magic) { magic--; if (magic < Menu.A) { magic = Menu.B; } } KeyLoader.keyLoader.SetStickWait(RESET_KEY); //カーソル移動音 SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); } else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.x > 0) { //魔法のキー変更 if (magic == Menu.B) { magic = Menu.A; } else { magic++; } //ジャンプと魔法が同じ if (jump == magic) { magic++; if (magic > Menu.B) { magic = Menu.A; } } KeyLoader.keyLoader.SetStickWait(RESET_KEY); //カーソル移動音 SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); } //変更した値をセーブする SaveData.SaveInt("MagicKey", magic); }
/// <summary> /// ポーズの終了 /// </summary> private void PoseEnd() { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Cancel)); Time.timeScale = 1; //再開後にキーの情報が残っているので解放 KeyLoader.keyLoader.KeyRelease(); towerState = backTowerState; keyCanvas.SetActive(true); BGMMaster.Play(); }
IEnumerator wait() { drawGo.SetActive(false); while (waitTime-- > 0) { yield return(new WaitForFixedUpdate()); } drawGo.SetActive(true); if (gameOverSound != null) { SEMaster.Play(gameOverSound); } }
/// <summary> /// タワーが閉じたか判定 /// </summary> void MoveEnd() { end = (leftWall.transform.position.x == leftEnd); if (end) { leftWall.transform.tag = "endWall"; rightWall.transform.tag = "endWall"; leftWall.gameObject.layer = LayerMask.NameToLayer("endWall"); rightWall.gameObject.layer = LayerMask.NameToLayer("endWall"); SEMaster.Play(batan); } }
/// <summary> /// "データ"処理を行う関数 /// </summary> void Delete() { if (!data.DeleteUpdate()) { if (!KeyLoader.keyLoader.StickWait && (KeyLoader.keyLoader.joyStickAxis.y < 0 || KeyLoader.keyLoader.joyStickAxis.y > 0)) { adjust = SELECT_MENU; SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } } }
/// <summary> /// ポーズの開始 /// </summary> private void PoseStart() { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Pause)); Time.timeScale = 0; KeyLoader.keyLoader.KeyRelease(); backTowerState = towerState; towerState = TowerState.Pose; gamePoiseUI.GamePauseUIStart(); XInputDotNetPure.GamePad.SetVibration(XInputDotNetPure.PlayerIndex.One, 0, 0); keyCanvas.SetActive(false); BGMMaster.Stop(); }
/// <summary> /// タイトルに戻る処理を行う関数 /// </summary> private void ReturnTitle() { if (KeyLoader.keyLoader.A) { KeyLoader.keyLoader.SetStickWait(Menu.FADE); KeyLoader.keyLoader.SetKeyWait(Menu.FADE); StartCoroutine(ReturnTitleRoutine(Menu.FADE)); SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide)); FadeIO.fadeIo.FadeOut(Menu.FADE); BGMMaster.AudioFadeOutStart(Menu.FADE); SEMaster.AudioFadeOutStart(Menu.FADE); } }
public bool GamePauseUIUpdate() { bool end = false; keyMoves(); if (KeyLoader.keyLoader.A) { if (meNam != 2) { end = true; SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide)); switch (meNam) { case 0: pauseEndPattern = PauseEndPattern.Back; break; case 1: pauseEndPattern = PauseEndPattern.Retry; break; case 3: pauseEndPattern = PauseEndPattern.StageSelect; break; case 4: pauseEndPattern = PauseEndPattern.Title; break; } } } else if (KeyLoader.keyLoader.B || KeyLoader.keyLoader.StartKey) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Cancel)); end = true; pauseEndPattern = PauseEndPattern.Back; } if (end) { gameObject.SetActive(false); } return(end); }
/// <summary> /// コンフィグの処理を行うアップデート関数 /// </summary> public void ConfigUpdate() { //コンフィグを表示する if (!wConfig.isMaxScale && !wConfig.isChanging && KeyLoader.keyLoader.A) { ResetMenu(); wConfig.StartExpansion(); StartCoroutine(backShadow.StartFadeIn()); SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide)); } //コンフィグが表示中 if (wConfig.isMaxScale && !wConfig.isChanging) { //コンフィグのメニューUIのアウトライン configString.SetString(menu); configStringOl.SetOutline(menu, adjust); SetSound(); SetKey(); //選択メニュー変更 if (adjust == SELECT_MENU) { if (!menuUIol.gameObject.activeSelf) { menuUIol.gameObject.SetActive(true); } menuUIol.SetImage(menu); SelectMenu(); } //選択設定の位置変更 else { if (menuUIol.gameObject.activeSelf) { menuUIol.gameObject.SetActive(false); } Setting(); } //メニューを閉じる if (!data.Message.isChanging && !data.Message.isMaxScale && KeyLoader.keyLoader.B) { wConfig.StartNarrow(); StartCoroutine(backShadow.StartFadeOut()); SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Cancel)); } } }
/// <summary> /// 深度1の設定を変更する関数を制御する /// </summary> private void Setting1() { switch (menu) { case Menu.CLOSE: if (KeyLoader.keyLoader.A) { Close(); SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide)); } break; case Menu.SOUND: bgmSprite.Draw(BGMvol); bgmCS.Draw(BGMvol); SettingBGM(); break; case Menu.BUTTON: jumpSprite.Set(jump); SettingJump(); break; case Menu.TITLE: ReturnTitle(); break; } //上 if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y > 0) { setting = SETTING_MENU; SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(RESET_KEY); } //下 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y < 0) { if (menu == Menu.CLOSE || menu == Menu.TITLE) { setting = SETTING_MENU; } else { setting = SETTING_2; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(RESET_KEY); } }
protected void KeyMove() { if (KeyLoader.keyLoader.joyStickAxis.x != 0 && !KeyLoader.keyLoader.StickWait) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); selectNam += 1; selectNam %= 2; KeyLoader.keyLoader.SetStickWait(keyWaitTime); SelectNam(); } else if (KeyLoader.keyLoader.joyStickAxis.x == 0) { KeyLoader.keyLoader.SetStickWait(0); } }
/// <summary> /// クレジットのアップデート関数 /// </summary> public void CreditUpdate() { if (!wCredit.isChanging && !wCredit.isMaxScale && KeyLoader.keyLoader.A) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide)); wCredit.StartExpansion(); StartCoroutine(backShadow.StartFadeIn()); } else if (!wCredit.isChanging && wCredit.isMaxScale && (KeyLoader.keyLoader.A || KeyLoader.keyLoader.B)) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Cancel)); wCredit.StartNarrow(); StartCoroutine(backShadow.StartFadeOut()); } }
/// <summary> /// "閉じる"処理を行う関数 /// </summary> void Close() { if (KeyLoader.keyLoader.A) { wConfig.StartNarrow(); StartCoroutine(backShadow.StartFadeOut()); SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Cancel)); } if (!KeyLoader.keyLoader.StickWait && (KeyLoader.keyLoader.joyStickAxis.y > 0 || KeyLoader.keyLoader.joyStickAxis.y < 0)) { adjust = SELECT_MENU; SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } }
/// <summary> /// ゲーム終了 /// </summary> void GameEnd() { if (KeyLoader.keyLoader.A) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Cancel)); menuSelect = false; KeyLoader.keyLoader.SetKeyWait(Menu.FADE); SaveData.AllSave(); FadeIO.fadeIo.SetFadeImage(FadeIO.black); FadeIO.fadeIo.FadeOut(Menu.FADE); BGMMaster.AudioFadeOutStart(Menu.FADE); SEMaster.AudioFadeOutStart(Menu.FADE); runningFunc = () => Shutdown(); StartCoroutine(RunCoroutine(Menu.FADE, runningFunc)); } }
/// <summary> /// ゲーム開始 /// </summary> void GameStart() { if (KeyLoader.keyLoader.A) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide)); menuSelect = false; KeyLoader.keyLoader.SetKeyWait(Menu.FADE); StageSelect.stage = Menu.MONSTER; SaveData.AllSave(); FadeIO.fadeIo.SetFadeImage(FadeIO.black); FadeIO.fadeIo.FadeOut(Menu.FADE); BGMMaster.AudioFadeOutStart(Menu.FADE); SEMaster.AudioFadeOutStart(Menu.FADE); runningFunc = () => LoadNextScene(); StartCoroutine(RunCoroutine(Menu.FADE, runningFunc)); } }
/// <summary> /// メニューの選択を行う関数 /// </summary> void SelectMenu() { //左 if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.x < 0) { menu--; if (menu < Menu.CLOSE) { menu = Menu.DATA; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } //右 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.x > 0) { menu++; if (menu > Menu.DATA) { menu = Menu.CLOSE; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } //下 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y < 0) { adjust = SELECT_SETTING1; SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } //上 else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y > 0) { if (menu == Menu.CLOSE || menu == Menu.DATA) { adjust = SELECT_SETTING1; } else { adjust = SELECT_SETTING2; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } }
/// <summary> /// "ボタン"処理を行う関数 /// </summary> void SelectKey() { //カーソル jumpCur.SetCursol(adjust == SELECT_SETTING1); magicCur.SetCursol(adjust == SELECT_SETTING2); //ジャンプ if (adjust == SELECT_SETTING1) { SettingJump(); } //魔法 else { SettingMagic(); } //深度変更 if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y > 0) { if (adjust == SELECT_SETTING1) { adjust = SELECT_MENU; } else { adjust = SELECT_SETTING1; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y < 0) { if (adjust == SELECT_SETTING1) { adjust = SELECT_SETTING2; } else { adjust = SELECT_MENU; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } }
/// <summary> /// ゲームオーバーの更新 /// </summary> void GameOverUpdate() { keyCanvas.SetActive(false); player.controlOn = false; TimeCounter.timeCounter.TimeCountStop(); gameOverNextSelectUI.NextSelectUpdate(); if (KeyLoader.keyLoader.A) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide)); string nextName = gameOverNextSelectUI.GetNextSceneName(); if (nextName == SceneNames.StageSelectName) { GotoStageSelect(); } else { Retry(); } } }
/// <summary> /// "サウンド"処理を行う関数 /// </summary> void SelectSoundVol() { //BGM if (adjust == SELECT_SETTING1) { SettingBGMvol(); } //SE else { SettingSEvol(); } //深度の変更 if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y > 0) { if (adjust == SELECT_SETTING1) { adjust = SELECT_MENU; } else { adjust = SELECT_SETTING1; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } else if (!KeyLoader.keyLoader.StickWait && KeyLoader.keyLoader.joyStickAxis.y < 0) { if (adjust == SELECT_SETTING1) { adjust = SELECT_SETTING2; } else { adjust = SELECT_MENU; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } }