// Update is called once per frame void Update() { //デバッグ用後で消して if (Input.GetButtonDown("Start")) { Application.LoadLevel("Title"); } //Debug.Log (Input.GetAxis("Vertical")); //街頭キャラのモードになった時そのキャラが表示されるモード切り替えはupdate○○のinput参照 switch (select) { case MovingSelect.Character: Character.SetActive(true); manu.SetActive(false); if (Input.GetKeyDown("space") || Input.GetButtonDown("Jump")) { select = MovingSelect.MainManu; GetComponents <AudioSource> ()[1].Play(); } switch (mode) { case MovingMode.Hero: updateHero(); break; case MovingMode.Kakashi: updateKakashi(); break; case MovingMode.Tamashibi: updateTamashibi(); break; case MovingMode.Pino: updatePino(); break; case MovingMode.Boss: updateBoss(); break; } break; case MovingSelect.MainManu: Character.SetActive(false); Story.SetActive(false); Credit.SetActive(false); manu.SetActive(true); updateMainManu(); break; case MovingSelect.Story: if (Input.GetKeyDown("space") || Input.GetButtonDown("Jump")) { select = MovingSelect.MainManu; GetComponents <AudioSource> ()[1].Play(); } Story.SetActive(true); manu.SetActive(false); updateStory(); break; case MovingSelect.Movie: Character.SetActive(false); manu.SetActive(false); updateMovie(); break; case MovingSelect.Credit: if (Input.GetKeyDown("space") || Input.GetButtonDown("Jump")) { select = MovingSelect.MainManu; GetComponents <AudioSource> ()[1].Play(); } manu.SetActive(false); Credit.SetActive(true); updateCredit(); break; } }
void updateMainManu() { //上下で羽ペンが移動する選択 if (InputTime == 0) { if (Input.GetKeyDown("up") || 1 == Input.GetAxisRaw("Vertical")) { select_type--; if (select_type <= -1) { select_type = 3; } switch (select_type) { case 0: Pen.transform.position = new Vector2(1.78f, 3.55f); InputTime = 100; GetComponents <AudioSource> () [0].Play(); break; case 1: Pen.transform.position = new Vector2(1.78f, 2.15f); InputTime = 100; GetComponents <AudioSource> () [0].Play(); break; case 2: Pen.transform.position = new Vector2(1.78f, 0.42f); InputTime = 100; GetComponents <AudioSource> () [0].Play(); break; case 3: Pen.transform.position = new Vector2(1.78f, -3.64f); InputTime = 100; GetComponents <AudioSource> () [0].Play(); break; } } if (Input.GetKeyDown("down") || -1 == Input.GetAxisRaw("Vertical")) { select_type++; if (select_type >= 4) { select_type = 0; } switch (select_type) { case 0: Pen.transform.position = new Vector2(1.78f, 3.55f); InputTime = 100; GetComponents <AudioSource> () [0].Play(); break; case 1: Pen.transform.position = new Vector2(1.78f, 2.15f); InputTime = 100; GetComponents <AudioSource> () [0].Play(); break; case 2: Pen.transform.position = new Vector2(1.78f, 0.42f); InputTime = 100; GetComponents <AudioSource> () [0].Play(); break; case 3: Pen.transform.position = new Vector2(1.78f, -3.64f); InputTime = 100; GetComponents <AudioSource> () [0].Play(); break; } } } //連続入力できないようにクールタイムを設けている if (InputTime > 0) { if (Input.GetAxisRaw("Vertical") == 0 && Input.GetAxisRaw("Horizontal") == 0) { InputTime = 0; } else { InputTime -= 5; } } if (Input.GetKeyDown("a") || Input.GetButtonDown("Attack")) { switch (select_type) { case 0: select = MovingSelect.Story; GetComponents <AudioSource> ()[1].Play(); break; case 1: select = MovingSelect.Character; GetComponents <AudioSource> ()[1].Play(); break; case 2: //select = MovingSelect.Movie ; GetComponents <AudioSource> ()[1].Play(); break; case 3: select = MovingSelect.Credit; GetComponents <AudioSource> ()[1].Play(); break; } } }