//---------------------------------------------------------------------- // ゴールのメッシュに当たったらその時点でゴール //---------------------------------------------------------------------- // @Param collider 当たったオブジェクトの当たり判定 // @Return none // @Date 2014/12/9 @Update 2014/12/9 @Author T.Kawashita //---------------------------------------------------------------------- void OnTriggerEnter(Collider collider) { if (collider.transform.tag == "SoccerBall") { // グローバルのゴールのデータに追加 TeamData.AddLog(CGameManager.m_nowTime, CSoccerBallManager.m_shootPlayerNo, CSoccerBallManager.m_shootTeamNo, 0, true); CGameManager.m_bluePoint++; CGameManager.m_nowStatus = CGameManager.eSTATUS.eGOAL; // サポーター追加 int redSupporter = 0; int blueSupporter = 0; // オウンゴールではない場合 if (CSoccerBallManager.m_shootTeamNo != 1) { // 同点に追いつくシュート if (TeamData.GetTeamScore(0) == TeamData.GetTeamScore(1)) { blueSupporter += CSupporterData.m_getDrawPointSupporter; } // 同点から逆転するシュート else if (TeamData.GetTeamScore(1) - 1 == TeamData.GetTeamScore(0)) { blueSupporter += CSupporterData.m_getDrawReversPointSupporter; } blueSupporter += CSupporterData.m_getPointSupporter; } // オウンゴールの場合は点数は入る else if (CSoccerBallManager.m_shootTeamNo == 2) { redSupporter += CSupporterData.m_getPointSupporter; } // 最後にサポーター追加 CSupporterManager.AddSupporter(redSupporter, blueSupporter, true); collider.gameObject.GetComponent <CSoccerBall>().StopTrail(); } }
//---------------------------------------------------------------------- // ゲーム終了待機状態 //---------------------------------------------------------------------- // @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/11/21 @Update 2014/11/21 @Author T.Takeuchi //---------------------------------------------------------------------- void Init() { GameObject[] panels = new GameObject[3]; // 各種値初期化 count = 0; for (int i = 0; i < 2; ++i) { works[i] = 0; } #if false // ドライバ TeamData.teamNationality[0] = TeamData.TEAM_NATIONALITY.JAPAN; TeamData.teamNationality[1] = TeamData.TEAM_NATIONALITY.ESPANA; TeamData.AddLog(0, 1, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(1, 2, 0, 1, true); TeamData.AddLog(2, 3, 1, 0, true); TeamData.AddLog(3, 4, 1, 0, true); TeamData.AddLog(4, 4, 1, 0, false); TeamData.suppoterByTeam[0] = 1234; TeamData.suppoterByTeam[1] = 5233; TeamData.suppoterByWorld = 100000000; #endif // ドライバ_END // パネルデータ読込 panels[0] = GameObject.Find("MainPanel") as GameObject; panels[1] = GameObject.Find("SubPanel0") as GameObject; panels[2] = GameObject.Find("SubPanel1") as GameObject; this.SubPanels[0, 0] = GameObject.Find("SubPanel00") as GameObject; this.SubPanels[0, 1] = GameObject.Find("SubPanel01") as GameObject; this.SubPanels[0, 2] = GameObject.Find("SubPanel02") as GameObject; this.SubPanels[1, 0] = GameObject.Find("SubPanel10") as GameObject; this.SubPanels[1, 1] = GameObject.Find("SubPanel11") as GameObject; this.SubPanels[1, 2] = GameObject.Find("SubPanel12") as GameObject; // ボタンデータ読み込み this.button[0, 0] = panels[1].transform.FindChild("Next_0").gameObject; this.button[0, 1] = panels[1].transform.FindChild("Next_1").gameObject; this.button[1, 0] = panels[2].transform.FindChild("Next_0").gameObject; this.button[1, 1] = panels[2].transform.FindChild("Next_1").gameObject; for (int j = 0; j < 3; j++) { for (int i = 0; i < 2; i++) { // チーム得点 panels[j].transform.FindChild("Score" + i).GetComponent <DrawNumber>().number = TeamData.GetTeamScore(i); panels[j].transform.FindChild("Score" + i).GetComponent <DrawNumber>().Init(); if (TeamData.GetTeamScore(i) < 10) { panels[j].transform.FindChild("Score" + i).transform.FindChild("num02").transform.localPosition = new Vector3(0.0f, 0.0f); } else { panels[j].transform.FindChild("Score" + i).transform.FindChild("num02").transform.localPosition = new Vector3(0.5f, 0.0f); } // 国旗国名 switch (TeamData.teamNationality[i]) { case TeamData.TEAM_NATIONALITY.BRASIL: panels[j].transform.FindChild("Flag" + i).GetComponent <UISprite>().spriteName = "BRA_type1"; panels[j].transform.FindChild("CountryName" + i).GetComponent <UISprite>().spriteName = "name_Brazil_" + i; break; case TeamData.TEAM_NATIONALITY.ENGLAND: panels[j].transform.FindChild("Flag" + i).GetComponent <UISprite>().spriteName = "ENG_type1"; panels[j].transform.FindChild("CountryName" + i).GetComponent <UISprite>().spriteName = "name_England_" + i; break; case TeamData.TEAM_NATIONALITY.ESPANA: panels[j].transform.FindChild("Flag" + i).GetComponent <UISprite>().spriteName = "ESP_type1"; panels[j].transform.FindChild("CountryName" + i).GetComponent <UISprite>().spriteName = "name_Spain_" + i; break; case TeamData.TEAM_NATIONALITY.JAPAN: panels[j].transform.FindChild("Flag" + i).GetComponent <UISprite>().spriteName = "JPN_type1"; panels[j].transform.FindChild("CountryName" + i).GetComponent <UISprite>().spriteName = "name_Japan_" + i; break; } } // 結果表示 switch (TeamData.GetWinTeamNo()) { case 0: switch (TeamData.teamNationality[0]) { case TeamData.TEAM_NATIONALITY.BRASIL: panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().spriteName = "name_Brazil_red"; break; case TeamData.TEAM_NATIONALITY.ENGLAND: panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().spriteName = "name_England_red"; break; case TeamData.TEAM_NATIONALITY.ESPANA: panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().spriteName = "name_Spain_red"; break; case TeamData.TEAM_NATIONALITY.JAPAN: panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().spriteName = "name_Japan_red"; break; } break; case 1: panels[j].transform.FindChild("VictorySprite").GetComponent <UISprite>().spriteName = "winner"; // 国旗国名 switch (TeamData.teamNationality[1]) { case TeamData.TEAM_NATIONALITY.BRASIL: panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().spriteName = "name_Brazil_blue"; break; case TeamData.TEAM_NATIONALITY.ENGLAND: panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().spriteName = "name_England_blue"; break; case TeamData.TEAM_NATIONALITY.ESPANA: panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().spriteName = "name_Spain_blue"; break; case TeamData.TEAM_NATIONALITY.JAPAN: panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().spriteName = "name_Japan_blue"; break; } break; case 2: panels[j].transform.FindChild("VictorySprite").GetComponent <UISprite>().spriteName = "draw"; panels[j].transform.FindChild("VictoryWorldName").GetComponent <UISprite>().enabled = false; panels[j].transform.FindChild("VictorySprite").localPosition = new Vector3(panels[j].transform.FindChild("VictorySprite").localPosition.x, panels[j].transform.FindChild("VictorySprite").localPosition.y - 50.0f, panels[j].transform.FindChild("VictorySprite").localPosition.z); break; } } // 数値初期化 for (int i = 0; i < 2; i++) { this.state[i] = RESULT_STATE.ALPHA_IN; this.suppoterBffByWorld[i] = TeamData.suppoterByWorld; for (int j = 0; j < 2; j++) { this.suppoterBffByTeam[i, j] = TeamData.suppoterByTeam[j]; } ReSetButtonCheck(i, false); } // TeamDataを統合、クリア TeamData.suppoterByWorld += (TeamData.suppoterByTeam[0] + TeamData.suppoterByTeam[1]); TeamData.suppoterByTeam[0] = TeamData.suppoterByTeam[1] = 0; TeamData.Save(); // シュートログをクリア TeamData.ClearLog(); CResultManager.m_resultMain.transform.FindChild("Camera").transform.FindChild("Anchor").transform.FindChild("MainPanel").transform.GetComponent <UIPanel>().alpha = 1; CResultManager.m_resultSub1.transform.FindChild("Camera").transform.FindChild("Anchor").transform.FindChild("SubPanel0").transform.GetComponent <UIPanel>().alpha = 1; CResultManager.m_resultSub2.transform.FindChild("Camera").transform.FindChild("Anchor").transform.FindChild("SubPanel1").transform.GetComponent <UIPanel>().alpha = 1; }