// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { Application.LoadLevel("Title"); } if (m_Fade_flag_1.m_SceneFlag == true && m_Fade_flag_2.m_SceneFlag == true) { if (m_isFade == false) { m_soundPlayer.PlayBGMFadeOut(0.003f); m_isFade = true; } m_Count += Time.deltaTime; if (m_Count >= 5.0f) { if (m_Fade_flag_1.m_Country[0].m_Flag == 3) { TeamData.teamNationality[0] = TeamData.TEAM_NATIONALITY.ESPANA; } else if (m_Fade_flag_1.m_Country[1].m_Flag == 3) { TeamData.teamNationality[0] = TeamData.TEAM_NATIONALITY.ENGLAND; } else if (m_Fade_flag_1.m_Country[2].m_Flag == 3) { TeamData.teamNationality[0] = TeamData.TEAM_NATIONALITY.BRASIL; } else if (m_Fade_flag_1.m_Country[3].m_Flag == 3) { TeamData.teamNationality[0] = TeamData.TEAM_NATIONALITY.JAPAN; } if (m_Fade_flag_2.m_Country[0].m_Flag == 3) { TeamData.teamNationality[1] = TeamData.TEAM_NATIONALITY.ESPANA; } else if (m_Fade_flag_2.m_Country[1].m_Flag == 3) { TeamData.teamNationality[1] = TeamData.TEAM_NATIONALITY.ENGLAND; } else if (m_Fade_flag_2.m_Country[2].m_Flag == 3) { TeamData.teamNationality[1] = TeamData.TEAM_NATIONALITY.BRASIL; } else if (m_Fade_flag_2.m_Country[3].m_Flag == 3) { TeamData.teamNationality[1] = TeamData.TEAM_NATIONALITY.JAPAN; } Application.LoadLevel("Tutorial"); } } }
// Update is called once per frame void Update() { if (m_entry1.m_inFlag == true && m_entry2.m_inFlag == true && m_entry3.m_inFlag == true && m_entry4.m_inFlag == true && m_Fade.m_FadeFlag == false) { m_SceneFlag = true; m_soundPlayer.PlayBGMFadeOut(0.003f); } if (m_StartCount >= 0.1f) { if (m_StartCount < 0.12f) { m_SE.VolumeSE(0.1f); m_SE.PlaySE("title/goTeamSelect"); } if (m_Fade.m_tweenAlpha.enabled == false) { Application.LoadLevel("ChooseTeam"); } } if (m_SceneFlag == true) { m_Fade.m_FadeFlag = true; m_StartCount += Time.deltaTime; } // スペースキーで強制的に次のシーンに飛ばす if (Input.GetKeyDown(KeyCode.Space)) { m_SceneFlag = true; } }
//---------------------------------------------------------------------- // ゲーム終了待機状態 //---------------------------------------------------------------------- // @Param none // @Return none // @Date 2014/10/28 @Update 2014/10/28 @Author T.Kawashita // @Update 2014/11/18 ゲーム終了待機状態に変更 //---------------------------------------------------------------------- private void GameEndWait() { // 60Fたったかどうか計算 m_frame += Time.deltaTime; if (m_frame >= 1.0f) { m_frame = 0; CGameData.m_gameEndTime--; // ここで何か終わりの表示 if (CGameData.m_gameEndTime <= 0) { // ゲーム終了待機が終わったらフェードアウトさせる m_nowStatus = eSTATUS.eFADEOUT; m_soundPlayer.PlayBGMFadeOut(0.02f); int teamPoint = 0; int redSupporter = 0; int blueSupporter = 0; if (TeamData.GetWinTeamNo() == 0) { redSupporter += CSupporterData.m_winSupporter; // 得点差を求める teamPoint = TeamData.GetTeamScore(0) - TeamData.GetTeamScore(1); if (teamPoint >= 2) { redSupporter += CSupporterData.m_point2WinSupporter; } blueSupporter += CSupporterData.m_loseSupporter; } else if (TeamData.GetWinTeamNo() == 1) { blueSupporter += CSupporterData.m_winSupporter; // 得点差を求める teamPoint = TeamData.GetTeamScore(1) - TeamData.GetTeamScore(0); if (teamPoint >= 2) { blueSupporter += CSupporterData.m_point2WinSupporter; } redSupporter += CSupporterData.m_loseSupporter; } else if (TeamData.GetWinTeamNo() == 2) { redSupporter += CSupporterData.m_drowSupporter; blueSupporter += CSupporterData.m_drowSupporter; teamPoint = TeamData.GetTeamScore(0); if (teamPoint >= 2) { redSupporter += CSupporterData.m_point2Drow; blueSupporter += CSupporterData.m_point2Drow; } } // 最後にサポーター追加 CSupporterManager.AddSupporter(redSupporter, blueSupporter, true); } } }
//---------------------------------------------------------------------- // 更新 //---------------------------------------------------------------------- // @Param none // @Return none // @Date 2014/10/29 @Update 2014/10/29 @Author T.Kawashita // 2014/11/15 @Update 2014/11/15 @Author T.Takeuchi // 2014/11/28 @Update 2014/11/28 @Author T.Takeuichi //---------------------------------------------------------------------- void Update() { // 表示 this.SubPanels[0, 0].transform.FindChild("NUM_Supporter_World").GetComponent <DrawNumber>().number = this.suppoterBffByWorld[0]; this.SubPanels[0, 1].transform.FindChild("NUM_Supporter_Team0").GetComponent <DrawNumber>().number = this.suppoterBffByTeam[0, 0]; this.SubPanels[0, 1].transform.FindChild("NUM_Supporter_Team1").GetComponent <DrawNumber>().number = this.suppoterBffByTeam[0, 1]; this.SubPanels[1, 0].transform.FindChild("NUM_Supporter_World").GetComponent <DrawNumber>().number = this.suppoterBffByWorld[1]; this.SubPanels[1, 1].transform.FindChild("NUM_Supporter_Team0").GetComponent <DrawNumber>().number = this.suppoterBffByTeam[1, 0]; this.SubPanels[1, 1].transform.FindChild("NUM_Supporter_Team1").GetComponent <DrawNumber>().number = this.suppoterBffByTeam[1, 1]; // ボタンチェック // 1P if ((Input.GetKeyDown(InputXBOX360.P1_XBOX_A) || Input.GetKeyDown(KeyCode.Alpha1)) && this.buttonCheck[0, 0] == false) { this.buttonCheck[0, 0] = true; m_soundPlayer.PlaySE("select/selector_select"); } // 2P if ((Input.GetKeyDown(InputXBOX360.P2_XBOX_A) || Input.GetKeyDown(KeyCode.Alpha2)) && this.buttonCheck[0, 1] == false) { m_soundPlayer.PlaySE("select/selector_select"); this.buttonCheck[0, 1] = true; } if ((Input.GetKeyDown(InputXBOX360.P3_XBOX_A) || Input.GetKeyDown(KeyCode.Alpha3)) && this.buttonCheck[1, 0] == false) { m_soundPlayer.PlaySE("select/selector_select"); this.buttonCheck[1, 0] = true; } if ((Input.GetKeyDown(InputXBOX360.P4_XBOX_A) || Input.GetKeyDown(KeyCode.Alpha4)) && this.buttonCheck[1, 1] == false) { m_soundPlayer.PlaySE("select/selector_select"); this.buttonCheck[1, 1] = true; } // デバッグ用ボタン this.DebugButton(); // ボタン表示 for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { if (this.buttonCheck[i, j] == true) { this.button[i, j].SetActive(false); } else { this.button[i, j].SetActive(true); } } } // 遷移(左右画面共有) switch (this.state[0]) { // 最初のフェードイン case RESULT_STATE.ALPHA_IN: if (GameObject.Find("FeedPanel").GetComponent <TweenAlpha>().enabled == false) { this.state[0] = RESULT_STATE.STAY_FIRST; this.state[1] = RESULT_STATE.STAY_FIRST; ReSetButtonCheck(0, false); ReSetButtonCheck(1, false); } break; // 最終待機 case RESULT_STATE.STAY_LAST: if (this.state[0] == this.state[1]) { this.state[0] = RESULT_STATE.WAIT; this.state[1] = RESULT_STATE.WAIT; this.count = 0; } break; // case RESULT_STATE.WAIT: this.count++; if (this.count > this.countMax) { this.state[0] = RESULT_STATE.ALPHA_OUT; this.state[1] = RESULT_STATE.ALPHA_OUT; GameObject.Find("FeedPanel").GetComponent <TweenAlpha>().Play(true); m_soundPlayer.PlayBGMFadeOut(0.004f); } break; // フェードアウト case RESULT_STATE.ALPHA_OUT: if (GameObject.Find("FeedPanel").GetComponent <TweenAlpha>().enabled == false) { Application.LoadLevel("Title"); } break; } // 遷移(左右画面別々) for (int i = 0; i < 2; i++) { switch (this.state[i]) { // 待機その1 case RESULT_STATE.STAY_FIRST: if (this.buttonCheck[i, 0] == true && this.buttonCheck[i, 1] == true) { this.SubPanels[i, 1].GetComponent <TweenAlpha>().enabled = true; this.state[i] = RESULT_STATE.ALPHA_TEAM_SUPPORTER; } break; // チームサポーターがフェードイン case RESULT_STATE.ALPHA_TEAM_SUPPORTER: if (this.SubPanels[i, 1].GetComponent <TweenAlpha>().enabled == false) { this.state[i] = RESULT_STATE.STAY_TEAM_SUPPORTER; ReSetButtonCheck(i, false); } break; // チームサポーターが表示状態で待機 case RESULT_STATE.STAY_TEAM_SUPPORTER: if (this.buttonCheck[i, 0] == true && this.buttonCheck[i, 1] == true) { this.SubPanels[i, 1].GetComponent <TweenPosition>().enabled = true; this.state[i] = RESULT_STATE.MOVING_TEAM_SUPPORTER; } break; // チームサポーターが上へ移動 case RESULT_STATE.MOVING_TEAM_SUPPORTER: if (this.SubPanels[i, 1].GetComponent <TweenPosition>().enabled == false) { this.SubPanels[i, 0].GetComponent <TweenAlpha>().enabled = true; this.state[i] = RESULT_STATE.ALPHA_WORLD_SUPPORTER; } break; // 全サポーターがフェードイン case RESULT_STATE.ALPHA_WORLD_SUPPORTER: if (this.SubPanels[0, 0].GetComponent <TweenAlpha>().enabled == false) { this.state[i] = RESULT_STATE.ADDING_WORLD_SUPPORTER; this.SubPanels[i, 0].GetComponent <TweenScale>().Play(true); works[0] = this.suppoterBffByTeam[i, 0] / this.AddSuppoterTime; works[1] = this.suppoterBffByTeam[i, 1] / this.AddSuppoterTime; } break; // 全サポーターに加算 case RESULT_STATE.ADDING_WORLD_SUPPORTER: m_time += Time.deltaTime; //m_soundPlayer.LoopSE("result/supoter_countup"); if (this.suppoterBffByTeam[i, 0] == 0 && this.suppoterBffByTeam[i, 1] == 0) { this.state[i] = RESULT_STATE.STAY_TWO; ReSetButtonCheck(i, false); this.SubPanels[i, 0].GetComponent <TweenScale>().enabled = false; m_soundPlayer.StopSE(); } else { for (int j = 0; j < 2; j++) { if (this.suppoterBffByTeam[i, j] >= works[j]) { this.suppoterBffByTeam[i, j] -= works[j]; this.suppoterBffByWorld[i] += works[j]; } else if (this.suppoterBffByTeam[i, j] != 0) { this.suppoterBffByTeam[i, j]--; this.suppoterBffByWorld[i]++; } } if (m_time >= 0.2f) { m_soundPlayer.PlaySE("result/supoter_countup"); m_time = 0.0f; // m_soundPlayer.StopSE(); } } break; // 全サポーターが加算終了し、待機中 case RESULT_STATE.STAY_TWO: if (this.buttonCheck[i, 0] == true && this.buttonCheck[i, 1] == true) { this.state[i] = RESULT_STATE.ALPHA_THANK_YOU; this.SubPanels[i, 2].GetComponent <TweenAlpha>().enabled = true; } break; // Thank you for Playing!! がフェードイン case RESULT_STATE.ALPHA_THANK_YOU: if (this.SubPanels[i, 2].GetComponent <TweenAlpha>().enabled == false) { this.state[i] = RESULT_STATE.STAY_LAST; } break; } } #if false // デバッグ用スペースキーが押されたら強制的にタイトル画面へ if (Input.GetKeyDown(KeyCode.Space) || InputXBOX360.IsGetAllStartButton()) { // ここにタイトル画面に遷移する時のアニメーションを書く // 今は強制的に画面を遷移 Application.LoadLevel("Title"); Debug.Log("Title画面に遷移"); } #endif }